Skip to content

Commit

Permalink
only handle git push and git tag push
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueHorn07 committed Sep 28, 2024
1 parent bf01e32 commit b2f9e6e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/github-action.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
on:
push:
release:
types: [published]

name: Docker Build and Push

Expand Down Expand Up @@ -50,9 +48,9 @@ jobs:
uses: aws-actions/amazon-ecr-login@v2
- name: Determine Prod/Dev Stage
run: |
if [[ ${{ github.event_name }} == 'release' ]]; then
if [[ ${{ github.ref_type }} == 'tag' ]]; then
echo "PROD"
echo "IMAGE_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
echo "IMAGE_TAG=${{ github.ref_name }}" >> $GITHUB_ENV
echo "NEXT_PUBLIC_ENV=prod" >> $GITHUB_ENV
else
echo "DEV"
Expand All @@ -67,7 +65,7 @@ jobs:
tags: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
build-args: |
"NEXT_PUBLIC_ENV=${{ env.NEXT_PUBLIC_ENV }}"
"POPO_VERSION=${{ github.event.release.tag_name || github.sha }}"
"POPO_VERSION=${{ env.NEXT_PUBLIC_ENV == 'prod' ? github.ref_name || github.sha }}"
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
Expand Down

0 comments on commit b2f9e6e

Please sign in to comment.