Regressed to include it in new PR #232
Workflow file for this run
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: Build Container Images | |
on: | |
push: | |
workflow_dispatch: | |
branches: | |
- main | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
build_scan_push: | |
name: Build-Scan-Push | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
dockerfile-dir: | |
- hmpps-devops-tools | |
- hmpps-mssql-tools | |
- hmpps-mysql-tools | |
- hmpps-wiremock | |
- hmpps-localstack | |
- hmpps-clamav | |
- hmpps-python-deps | |
permissions: | |
packages: write | |
contents: read | |
security-events: write | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Docker metadata | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.dockerfile-dir }} | |
flavor: | | |
latest=true | |
tags: | | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=tag | |
type=ref,event=pr | |
type=sha | |
- name: Log in to GitHub container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build container image | |
uses: docker/build-push-action@v3 | |
with: | |
context: ./${{ matrix.dockerfile-dir }} | |
pull: true | |
push: false | |
tags: | | |
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ matrix.dockerfile-dir }}:${{ github.sha }} | |
- name: Push container image to repository | |
# Only push to repo if on main branch | |
if: ${{ github.ref == 'refs/heads/main' }} | |
uses: docker/build-push-action@v3 | |
with: | |
context: ./${{ matrix.dockerfile-dir }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
push: true | |
- name: Slack notification | |
id: slack | |
if: ${{ failure() }} | |
uses: slackapi/slack-github-action@v1.23.0 | |
with: | |
channel-id: ${{ secrets.SLACK_GITHUB_ALERTS }} | |
slack-message: "_Job:_ ${{ github.job }}\n_Status:_ ${{ job.status }}\n_Workflow:_ ${{ github.workflow }}\n_Repo:_ ${{ github.repository }}\n<https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}|View on github>\n" | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.HMPPS_SLACK_BOT_TOKEN }} |