Skip to content

Support CI pipelines #22

Support CI pipelines

Support CI pipelines #22

Workflow file for this run

name: vorpal
on:
pull_request:
push:
branches:
- main
env:
REGISTRY: ghcr.io
jobs:
build:
strategy:
matrix:
runner:
- ubuntu-latest
- ubuntu-latest-arm64
target:
- vorpal
- vorpal-sandbox
runs-on: ${{ matrix.runner }}
permissions:
attestations: write
contents: read
id-token: write
packages: write
steps:
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: actions/checkout@v4
- id: meta
uses: docker/metadata-action@v5
with:
annotations: |
org.opencontainers.image.description=Build and deliver software reliably with one magical tool.
images: ${{ env.REGISTRY }}/alt-f4-llc/${{ matrix.target }}
labels: |
org.opencontainers.image.title=${{ matrix.target }}
org.opencontainers.image.description=Build and deliver software reliably with one magical tool.
org.opencontainers.image.vendor=ALT-F4-LLC
tags: |
edge
- if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
- run: |
if [ "${{ matrix.target }}" == "vorpal-sandbox" ]; then
echo "DOCKERFILE=Dockerfile.sandbox" >> $GITHUB_ENV
else
echo "DOCKERFILE=Dockerfile" >> $GITHUB_ENV
fi
- id: push
uses: docker/build-push-action@v6
with:
cache-from: type=gha
cache-to: type=gha,mode=max
file: ${{ env.DOCKERFILE }}
labels: ${{ steps.meta.outputs.labels }}
load: true
push: ${{ github.ref == 'refs/heads/main' }}
tags: ${{ steps.meta.outputs.tags }}
- if: github.ref == 'refs/heads/main'
uses: actions/attest-build-provenance@v1
with:
push-to-registry: true
subject-digest: ${{ steps.push.outputs.digest }}
subject-name: ${{ env.REGISTRY }}/alt-f4-llc/${{ matrix.target }}
- if: matrix.target == 'vorpal'
run: |
ARCH=$(uname -m | tr '[:upper:]' '[:lower:]')
ID="$(docker container create ${{ env.REGISTRY }}/alt-f4-llc/${{ matrix.target }}:edge)"
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
mkdir -p dist
docker container cp $ID:/usr/local/bin/vorpal ./dist/vorpal
docker rm --force $ID
tar -czvf vorpal-$ARCH-$OS.tar.gz -C ./dist vorpal
echo "ARCH=$ARCH" >> $GITHUB_ENV
echo "OS=$OS" >> $GITHUB_ENV
- if: matrix.target == 'vorpal'
uses: actions/upload-artifact@v4
with:
name: vorpal-${{ env.ARCH }}-${{ env.OS }}
path: vorpal-${{ env.ARCH }}-${{ env.OS }}.tar.gz