Produce release images #3
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: Produce release images | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: Test version input | |
required: true | |
type: string | |
# push: | |
# tags: | |
# - v* | |
jobs: | |
push_images: | |
name: Push images to GHCR | |
runs-on: [self-hosted, khaos] | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Parse version tag | |
id: version | |
# actual shell script for below | |
# VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
# VERSION=$(echo $VERSION | sed -e 's/^v//') | |
run: | | |
echo "::set-output name=version::${{ inputs.version }}" | |
- name: Log in to Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract Zeek metadata for Docker | |
id: zeek-meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ghcr.io/mcmaster-circ/canids-v2-zeek | |
- name: Extract Backend metadata for Docker | |
id: backend-meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ghcr.io/mcmaster-circ/canids-v2-backend | |
- name: Extract Ingestion metadata for Docker | |
id: ingestion-meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ghcr.io/mcmaster-circ/canids-v2-ingestion | |
- name: Build and push Zeek | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ingestion/Dockerfile-zeek | |
push: true | |
tags: ghcr.io/mcmaster-circ/canids-v2-zeek:latest,ghcr.io/mcmaster-circ/canids-v2-zeek:${{ steps.version.outputs.version }} | |
labels: ${{ steps.zeek-meta.outputs.labels }} | |
- name: Build and push Backend | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: backend/Dockerfile | |
tags: ghcr.io/mcmaster-circ/canids-v2-backend:latest,ghcr.io/mcmaster-circ/canids-v2-backend:${{ steps.version.outputs.version }} | |
labels: ${{ steps.backend-meta.outputs.labels }} | |
- name: Build and push Ingestion | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ingestion/Dockerfile | |
tags: ghcr.io/mcmaster-circ/canids-v2-ingestion:latest,ghcr.io/mcmaster-circ/canids-v2-ingestion:${{ steps.version.outputs.version }} | |
labels: ${{ steps.ingestion-meta.outputs.labels }} |