Skip to content

Commit

Permalink
TEMP: Add workflow dispatch for building docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
Askaholic committed Dec 22, 2024
1 parent 0a667d2 commit 9144912
Showing 1 changed file with 31 additions and 9 deletions.
40 changes: 31 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,44 @@ name: Build
on:
release:
types: [published]
workflow_dispatch:
inputs:
repository:
description: Repository
ref:
description: Ref
tag:
description: Tag

jobs:
docker-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}
ref: ${{ inputs.ref }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: faforever/faf-python-server
tags:
type=ref

- name: Extract tag name
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and publish docker image
uses: docker/build-push-action@v1.1.1
- 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: Build and publish docker image
uses: docker/build-push-action@v6
with:
build-args: GITHUB_REF=${{ github.ref_name }}
tags: ${{ inputs.tag || steps.meta.outputs.tags }}
push: true

0 comments on commit 9144912

Please sign in to comment.