diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2739d36ba..06ae0b2ee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,22 +4,46 @@ name: Build on: release: types: [published] + workflow_dispatch: + inputs: + repository: + description: Repository + ref: + description: Ref + tag: + description: Tag + default: faforever/faf-python-server:latest 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=semver,pattern={{raw}} + type=ref,event=branch - - 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