Skip to content

Merge pull request #2 from DFE-Digital/test-new-action #3

Merge pull request #2 from DFE-Digital/test-new-action

Merge pull request #2 from DFE-Digital/test-new-action #3

name: Extend, build and push docker image
on:
push:
branches:
- 'main'
paths:
- 'Dockerfile'
- '.github/workflows/build-and-push-docker-image.yaml'
- '*.py'
- 'yaml-templates/*'
schedule:
- cron: '0 8 * * *'
workflow_call:
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Docker login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/dfe-digital/automated-threat-models
- name: Build and push image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}