Skip to content

improve docker images, improve ci #86

improve docker images, improve ci

improve docker images, improve ci #86

name: Rebuild Workload image (triggerable)
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: true
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: Build and push
uses: docker/build-push-action@v6
with:
context: workload
push: ${{ github.event_name != 'pull_request' }}
tags: |
ghcr.io/heliaxdev/ant-workload:${{ github.event.inputs.tag || github.sha }}
us-central1-docker.pkg.dev/molten-verve-216720/heliax-repository/workload:${{ github.event.inputs.tag || github.sha }}
cache-from: type=gha,scope=workload-image
cache-to: type=gha,scope=workload-image,mode=max