Files
alma-assignments-reporter/.gitea/workflows/ci.yaml
T
Joe Julian 2ef915b37a
CI / test (push) Successful in 28s
CI / publish (push) Failing after 21s
Use Buildah for registry publishing
2026-03-28 16:46:56 -07:00

56 lines
1.4 KiB
YAML

name: CI
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Test
run: go test ./...
- name: Build
run: go build .
publish:
if: gitea.event_name == 'push' && gitea.ref == 'refs/heads/main'
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Buildah
run: |
apt-get update
apt-get install -y buildah
- name: Login to Gitea Registry
env:
REGISTRY_HOST: ${{ vars.REGISTRY_HOST }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
run: |
printf '%s' "${REGISTRY_PASSWORD}" | buildah login --tls-verify=false -u "${GITHUB_REPOSITORY_OWNER}" --password-stdin "${REGISTRY_HOST}"
- name: Build and Push Image
env:
REGISTRY_HOST: ${{ vars.REGISTRY_HOST }}
run: |
export BUILDAH_ISOLATION=chroot
image="${REGISTRY_HOST}/${GITHUB_REPOSITORY}"
buildah bud --storage-driver=vfs --format docker -t "${image}:main" -t "${image}:sha-${GITHUB_SHA}" .
buildah push --tls-verify=false "${image}:main"
buildah push --tls-verify=false "${image}:sha-${GITHUB_SHA}"