fix : fix build failure #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Build (Dev) | ||
on: | ||
workflow_run: | ||
workflows: ["ESLint"] | ||
types: | ||
- completed | ||
branches: | ||
- dev | ||
push: | ||
branches: | ||
- dev | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- dev | ||
jobs: | ||
build: | ||
if: | | ||
Check failure on line 21 in .github/workflows/docker-build-dev.yml GitHub Actions / Docker Build (Dev)Invalid workflow file
|
||
github.event.workflow_run.conclusion == 'success' | ||
github.event_name == 'push' || | ||
(github.event_name == 'pull_request' && github.event.pull_request.merged == true) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ vars.AWS_REGION }} | ||
- name: Log in to AWS ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
- name: Extract repository name and short commit ID | ||
id: extract_repo | ||
run: | | ||
REPO_NAME=$(echo "${{ github.repository }}" | awk -F '/' '{print $2}' | tr '[:upper:]' '[:lower:]') | ||
SHORT_COMMIT_ID=$(echo "${{ github.sha }}" | cut -c1-7) | ||
echo "repo_name=${REPO_NAME}" >> $GITHUB_OUTPUT | ||
echo "short_commit_id=${SHORT_COMMIT_ID}" >> $GITHUB_OUTPUT | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
push: true | ||
tags: | | ||
${{ steps.login-ecr.outputs.registry }}/${{ steps.extract_repo.outputs.repo_name }}:dev-${{ steps.extract_repo.outputs.short_commit_id }} | ||
${{ steps.login-ecr.outputs.registry }}/${{ steps.extract_repo.outputs.repo_name }}:dev-latest |