Update docker-image.yml

This commit is contained in:
João Vitória Silva
2023-11-29 14:23:56 +00:00
committed by GitHub
parent 39393e2496
commit fac3e6397f

View File

@@ -16,6 +16,9 @@ jobs:
runs-on: ubuntu-latest
env:
IMAGE_TAG: ${{ github.event.release.tag_name }}
steps:
- name: Checkout code
uses: actions/checkout@v3
@@ -23,19 +26,17 @@ jobs:
- 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: |