Skip to content

Commit

Permalink
Update docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
joaovitoriasilva authored Nov 29, 2023
1 parent 39393e2 commit fac3e63
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,27 @@ jobs:

runs-on: ubuntu-latest

env:
IMAGE_TAG: ${{ github.event.release.tag_name }}

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set release version or use default
run: echo "RELEASE_VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
if: github.event_name == 'release'

- name: Build the Docker image
run: |
if [ "${{ github.event_name }}" == 'workflow_dispatch' ]; then
IMAGE_TAG="dev_$(date +"%Y%m%d")"
else
IMAGE_TAG="${{ github.event.release.tag_name }}"
fi
echo "IMAGE_TAG=${IMAGE_TAG}"
docker build . --file Dockerfile --tag ${{ github.repository }}:$IMAGE_TAG
#run: docker build . --file Dockerfile --tag ${{ github.repository }}:latest
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'


- name: Push the Docker image to GHCR
if: success() && (github.event_name == 'release' || github.event_name == 'workflow_dispatch')
run: |
Expand Down

0 comments on commit fac3e63

Please sign in to comment.