Skip to content

Build and Publish Docker Image #49

Build and Publish Docker Image

Build and Publish Docker Image #49

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
steps:
- name: checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: ministryofjustice/tech-docs-github-pages-publisher:ministryofjustice-fork
build-args: |
BUNDLE_RUBYGEMS__PKG__GITHUB__COM=${{ secrets.GITHUB_TOKEN }}
- name: Report failure to Slack
if: always()
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: "failure"
notification_title: "Failed GitHub Action Run"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}