Add workflow dispatch support in build.yml

- To support dispatch, set the image label based on the branch name
- Master build should still be tagged with latest to get benefit of the standard production Docker label
This commit is contained in:
Saba 2022-09-15 20:28:41 +03:00
parent 8f57a62675
commit a53094ec92

View file

@ -11,6 +11,10 @@ on:
- Dockerfile - Dockerfile
- docker-compose.yml - docker-compose.yml
- .github/workflows/build.yml - .github/workflows/build.yml
workflow_dispatch:
env:
DOCKER_IMAGE_TAG: ${{ github.ref == 'refs/heads/master' && 'latest' || github.ref_name }}
jobs: jobs:
build: build:
@ -36,6 +40,6 @@ jobs:
context: . context: .
file: Dockerfile file: Dockerfile
push: true push: true
tags: ghcr.io/${{ github.repository }}:latest tags: ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }}
build-args: | build-args: |
PORT=8000 PORT=8000