This repository has been archived by the owner on Aug 16, 2024. It is now read-only.
Docker builds - manual and tagged #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker builds - manual and tagged | |
on: | |
workflow_dispatch: | |
inputs: | |
image_tag: | |
description: "Image Tag value" | |
type: "string" | |
required: true | |
push: | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+-?[a-zA-Z]*' | |
- '[0-9]+.[0-9]+.[0-9]+' | |
- '!bwsm-eso-provider-*' | |
paths: | |
- src/** | |
jobs: | |
docker-image-build: | |
environment: 'dockerhub' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
strategy: | |
matrix: | |
platform: [amd64, arm64] | |
steps: | |
- name: Code Checkout | |
uses: actions/checkout@v4 | |
- name: Dockerhub Login | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PAT }} | |
- name: ARM64 QEMU Setup | |
if: matrix.platform == 'arm64' | |
uses: docker/setup-qemu-action@v3 | |
- name: Docker Buildx Setup | |
uses: docker/setup-buildx-action@v3 | |
- name: Architecture specific Environment Variable Setup | |
run: | | |
echo "BWS_DL_ARCH=$(if [ '${{ matrix.platform }}' == 'amd64' ]; then echo 'x86_64'; else echo 'aarch64'; fi)" >> $GITHUB_ENV | |
echo "ARCH=${{ matrix.platform }}" >> $GITHUB_ENV | |
- name: Manual Build/Push | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
platforms: linux/amd64, linux/arm64 | |
context: src | |
build-args: | | |
BWS_DL_ARCH=${{ env.BWS_DL_ARCH }} | |
ARCH=${{ env.ARCH }} | |
tags: | | |
bojanraic/bwsm-eso:${{ inputs.image_tag }} | |
- name: Tagged Build/Push | |
if: ${{ github.event_name != 'workflow_dispatch' }} | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
platforms: linux/amd64, linux/arm64 | |
context: src | |
build-args: | | |
BWS_DL_ARCH=${{ env.BWS_DL_ARCH }} | |
ARCH=${{ env.ARCH }} | |
tags: | | |
bojanraic/bwsm-eso:${{ github.ref_name }} | |
bojanraic/bwsm-eso:latest | |
- name: Tagged Release | |
if: ${{ github.event_name != 'workflow_dispatch' }} | |
uses: ncipollo/release-action@v1 | |
with: | |
generateReleaseNotes: true | |
name: v${{ github.ref_name }} |