Skip to content

Commit

Permalink
Update build action to create docker tag on PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
Askaholic committed Nov 24, 2024
1 parent 0a667d2 commit 3324ec1
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,27 @@ name: Build
on:
release:
types: [published]
pull_request:

jobs:
docker-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Extract tag name
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT

- name: Build and publish docker image
uses: docker/[email protected]
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
repository: faforever/faf-python-server
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
build_args: GITHUB_REF=${{ steps.vars.outputs.tag }}
tag_with_ref: true

- name: Docker auto tag
id: meta
uses: docker/metadata-action@v5
with:
images: faforever/faf-python-server

- name: Build and publish docker image
uses: docker/build-push-action@v6
with:
build-args: GITHUB_REF=${{ github.event_name == 'release' && github.ref_name || github.head_ref }}

0 comments on commit 3324ec1

Please sign in to comment.