minors #118
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: Rebuild Workload image | |
on: | |
workflow_dispatch: | |
inputs: | |
workload_commit: | |
description: "The container tag" | |
required: true | |
type: string | |
pull_request: | |
paths: | |
- 'workload/**' | |
push: | |
branches: | |
- master | |
paths: | |
- 'workload/**' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | |
permissions: | |
contents: read | |
packages: write | |
attestations: write | |
id-token: write | |
jobs: | |
workload-container: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: us-central1-docker.pkg.dev/molten-verve-216720/heliax-repository | |
username: _json_key | |
password: ${{ secrets.ANTITHESIS_GAR_JSON_KEY }} | |
- name: Login to ghcr.io | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Docker metadata | |
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }} | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/heliaxdev/ant-workload | |
us-central1-docker.pkg.dev/molten-verve-216720/heliax-repository/workload | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Build and push (pull request / push) | |
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }} | |
uses: docker/build-push-action@v6 | |
with: | |
context: workload | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
cache-from: type=gha,scope=workload-image | |
cache-to: type=gha,scope=workload-image,mode=max | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Build and push (workflow_dispatch) | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
uses: docker/build-push-action@v6 | |
with: | |
context: workload | |
push: true | |
tags: | | |
ghcr.io/heliaxdev/ant-workload:${{ github.event.inputs.tag }} | |
us-central1-docker.pkg.dev/molten-verve-216720/heliax-repository/workload:${{ github.event.inputs.tag }} | |
cache-from: type=gha,scope=workload-image | |
cache-to: type=gha,scope=workload-image,mode=max |