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-14 13:32:44 +03:00
parent 8f57a62675
commit 240901e07f

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 }}
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