Skip to content

Merge pull request #4 from mpwsh/mpw/use-htmx #24

Merge pull request #4 from mpwsh/mpw/use-htmx

Merge pull request #4 from mpwsh/mpw/use-htmx #24

Workflow file for this run

name: Release Image
on:
push:
branches:
- main
- release
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
DOCKERHUB_OPERATOR_REPO: ${{ vars.DOCKERHUB_USER }}/operator
DOCKERHUB_SERVER_REPO: ${{ vars.DOCKERHUB_USER }}/server
DOCKERHUB_CONSOLE_REPO: ${{ vars.DOCKERHUB_USER }}/console
DOCKERHUB_INIT_REPO: ${{ vars.DOCKERHUB_USER }}/init
jobs:
build:
strategy:
matrix:
arch: [amd64, arm64]
runs-on: ${{ matrix.arch }}
environment: release
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ vars.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- run: |
docker context create ci
docker context use ci
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: image=moby/buildkit:master
version: v0.10.4
endpoint: ci
- name: Build and push operator
uses: docker/build-push-action@v3
with:
context: .
file: ./docker/Dockerfile
target: operator
push: true
provenance: false
platforms: linux/${{ matrix.arch }}
tags: ${{ env.DOCKERHUB_OPERATOR_REPO}}:latest-${{ matrix.arch }}
cache-from: type=gha,scope=${{ github.ref}}-${{ matrix.arch }}
cache-to: type=gha,scope=${{ github.ref}}-${{ matrix.arch }},mode=max
- name: Build and push server
uses: docker/build-push-action@v3
with:
context: .
file: ./docker/Dockerfile
target: server
push: true
provenance: false
platforms: linux/${{ matrix.arch }}
tags: ${{ env.DOCKERHUB_SERVER_REPO}}:latest-${{ matrix.arch }}
cache-from: type=gha,scope=${{ github.ref}}-${{ matrix.arch }}
cache-to: type=gha,scope=${{ github.ref}}-${{ matrix.arch }},mode=max
- name: Build and push console
uses: docker/build-push-action@v3
with:
context: .
file: ./docker/Dockerfile
target: console
push: true
provenance: false
platforms: linux/${{ matrix.arch }}
tags: ${{ env.DOCKERHUB_CONSOLE_REPO}}:latest-${{ matrix.arch }}
cache-from: type=gha,scope=${{ github.ref}}-${{ matrix.arch }}
cache-to: type=gha,scope=${{ github.ref}}-${{ matrix.arch }},mode=max
- name: Build and push init container
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile.initContainer
push: true
provenance: false
platforms: linux/${{ matrix.arch }}
tags: ${{ env.DOCKERHUB_INIT_REPO}}:latest-${{ matrix.arch }}
cache-from: type=gha,scope=${{ github.ref}}-${{ matrix.arch }}-init
cache-to: type=gha,scope=${{ github.ref}}-${{ matrix.arch }}-init,mode=max
finalize:
needs: build
runs-on: ubuntu-latest
environment: release
steps:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ vars.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Merge operator image tags
uses: Noelware/docker-manifest-action@master
with:
inputs: ${{ env.DOCKERHUB_OPERATOR_REPO }}:latest,${{ env.DOCKERHUB_OPERATOR_REPO }}:${{ github.sha }}
images: ${{ env.DOCKERHUB_OPERATOR_REPO }}:latest-amd64,${{ env.DOCKERHUB_OPERATOR_REPO }}:latest-arm64
push: true
- name: Merge server image tags
uses: Noelware/docker-manifest-action@master
with:
inputs: ${{ env.DOCKERHUB_SERVER_REPO }}:latest,${{ env.DOCKERHUB_SERVER_REPO }}:${{ github.sha }}
images: ${{ env.DOCKERHUB_SERVER_REPO }}:latest-amd64,${{ env.DOCKERHUB_SERVER_REPO }}:latest-arm64
push: true
- name: Merge console image tags
uses: Noelware/docker-manifest-action@master
with:
inputs: ${{ env.DOCKERHUB_CONSOLE_REPO }}:latest,${{ env.DOCKERHUB_CONSOLE_REPO }}:${{ github.sha }}
images: ${{ env.DOCKERHUB_CONSOLE_REPO }}:latest-amd64,${{ env.DOCKERHUB_CONSOLE_REPO }}:latest-arm64
push: true
- name: Merge init container image tags
uses: Noelware/docker-manifest-action@master
with:
inputs: ${{ env.DOCKERHUB_INIT_REPO }}:latest,${{ env.DOCKERHUB_INIT_REPO }}:${{ github.sha }}
images: ${{ env.DOCKERHUB_INIT_REPO }}:latest-amd64,${{ env.DOCKERHUB_INIT_REPO }}:latest-arm64
push: true