Skip to content

Build and Publish Docker Image #50

Build and Publish Docker Image

Build and Publish Docker Image #50

Workflow file for this run

name: Publish docker image
on:
workflow_dispatch:
release:
types: [published]
permissions:
packages: read
jobs:
push_to_registry:
name: Push image to docker hub
runs-on: ubuntu-latest
strategy:
matrix:
platform: [amd64, arm64]
steps:
- name: checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set tag
run: |
if [ "${{ matrix.platform }}" = "arm64" ]; then
echo "tag=ministryofjustice-fork-arm64" >> "$GITHUB_ENV"
else
echo "tag=ministryofjustice-fork" >> "$GITHUB_ENV"
fi
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: ministryofjustice/tech-docs-github-pages-publisher:${{ env.tag }}
build-args: |
BUNDLE_RUBYGEMS__PKG__GITHUB__COM=${{ secrets.GITHUB_TOKEN }}