Skip to content

chore: add image-name variable #12

chore: add image-name variable

chore: add image-name variable #12

Workflow file for this run

name: 프로덕션 워크플로우
on:
push:
branches: [ 'main', 'feature/OING-16' ]
paths:
- 'config/**' # Config 모듈 변경
- 'member/**' # Member 모듈 변뚶
- '.github/workflows/**' # 워크플로우와 관련된 파일이 변경된 경우
- 'build.gradle' # Parent Gradle 모듈 설정이 변경된 경우
- 'settings.gradle' # Parent Gradle 설정이 변경된 경우
env:
SPRING_PROFILE: prod
ENVIRONMENT: production
IMAGE_NAME: no5ing/spring-was
concurrency:
group: production
jobs:
prepare-variables:
name: 환경변수 준비하기
runs-on: ubuntu-latest
outputs:
image-tag: ${{ steps.setup-env.outputs.image-tag }}
spring-profile: ${{ steps.setup-env.outputs.spring-profile }}
environment: ${{ steps.setup-env.outputs.environment }}
image-name: ${{ steps.setup-env.outputs.image-name }}
steps:
- name: GitHub 에서 레포 받아오기
uses: actions/checkout@v3
- name: 환경변수 출력하기
id: setup-env
run: |
echo "image-tag=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "spring-profile=$SPRING_PROFILE" >> $GITHUB_OUTPUT
echo "environment=$ENVIRONMENT" >> $GITHUB_OUTPUT
echo "image-name=$IMAGE_NAME" >> $GITHUB_OUTPUT
call-build-workflow:
if: github.event_name == 'push'
needs: [ prepare-variables ]
name: 이미지 빌드
uses: ./.github/workflows/build.yaml
permissions:
id-token: write
contents: read
with:
image-tag: ${{ needs.prepare-variables.outputs.image-tag }}
spring-profile: ${{ needs.prepare-variables.outputs.spring-profile }}
image-name: ${{ needs.prepare-variables.outputs.image-name }}
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
call-deploy-workflow:
if: github.event_name == 'push'
needs: [ prepare-variables, call-build-workflow ]
name: 서비스 배포
uses: ./.github/workflows/deploy.yaml

Check failure on line 61 in .github/workflows/prod.yaml

View workflow run for this annotation

GitHub Actions / 프로덕션 워크플로우

Invalid workflow file

The workflow is not valid. .github/workflows/prod.yaml (Line: 61, Col: 11): Input envirionment is required, but not provided while calling. .github/workflows/prod.yaml (Line: 74, Col: 20): Invalid input, environment is not defined in the referenced workflow.
permissions:
id-token: write
contents: read
secrets:
REMOTE_SSH_HOST: ${{ secrets.REMOTE_SSH_HOST }}
REMOTE_SSH_USERNAME: ${{ secrets.REMOTE_SSH_USERNAME }}
REMOTE_SSH_KEY: ${{ secrets.REMOTE_SSH_KEY }}
REMOTE_SSH_PASSPHRASE: ${{ secrets.REMOTE_SSH_PASSPHRASE }}
REMOTE_SSH_PORT: ${{ secrets.REMOTE_SSH_PORT }}
with:
image-tag: ${{ needs.prepare-variables.outputs.image-tag }}
spring-profile: ${{ needs.prepare-variables.outputs.spring-profile }}
environment: ${{ needs.prepare-variables.outputs.environment }}
image-name: ${{ needs.prepare-variables.outputs.image-name }}