Skip to content

Merge pull request #77 from CentreForDigitalHumanities/develop #10

Merge pull request #77 from CentreForDigitalHumanities/develop

Merge pull request #77 from CentreForDigitalHumanities/develop #10

Workflow file for this run

name: Build and Push Docker Images
on:
push:
tags:
- '*'
workflow_dispatch:
env:
AGENT_IMAGE_NAME: humitifier
AGENT_DOCKERFILE_PATH: ./agent/Dockerfile
AGENT_CONTEXT_PATH: ./agent
SERVER_IMAGE_NAME: humitifier-server
SERVER_DOCKERFILE_PATH: ./humitifier-server/Dockerfile
SERVER_CONTEXT_PATH: ./humitifier-server
jobs:
build-and-push-agent:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push main image
uses: docker/build-push-action@v6
with:
context: ${{ env.AGENT_CONTEXT_PATH }}
file: ${{ env.AGENT_DOCKERFILE_PATH }}
push: true
tags: |
ghcr.io/centrefordigitalhumanities/humitifier/${{ env.AGENT_IMAGE_NAME }}:${{ github.ref_name }}
# ghcr.io/centrefordigitalhumanities/humitifier/${{ env.AGENT_IMAGE_NAME }}:latest
- name: Grype Scan
id: scan
uses: anchore/scan-action@v3
with:
image: ghcr.io/centrefordigitalhumanities/humitifier/${{ env.AGENT_IMAGE_NAME }}:${{ github.ref_name }}
fail-build: false
- name: upload Grype SARIF report
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.scan.outputs.sarif }}
build-and-push-server:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push main image
uses: docker/build-push-action@v6
with:
context: ${{ env.SERVER_CONTEXT_PATH }}
file: ${{ env.SERVER_DOCKERFILE_PATH }}
push: true
tags: |
ghcr.io/centrefordigitalhumanities/humitifier/${{ env.SERVER_IMAGE_NAME }}:${{ github.ref_name }}
# ghcr.io/centrefordigitalhumanities/humitifier/${{ env.SERVER_IMAGE_NAME }}:latest
- name: Grype Scan
id: scan
uses: anchore/scan-action@v3
with:
image: ghcr.io/centrefordigitalhumanities/humitifier/${{ env.SERVER_IMAGE_NAME }}:${{ github.ref_name }}
fail-build: false
- name: upload Grype SARIF report
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.scan.outputs.sarif }}