Files
Website/.gitea/workflows/container.yml
T
KenanZhu 9065a0d3cf
Build and test website container / build (push) Successful in 11m33s
Build and smoke-test AutoLibrary as a container
2026-11-04 10:45:57 +08:00

36 lines
961 B
YAML

name: Build and test website container
on:
push:
branches: [main, container-ci]
workflow_dispatch:
jobs:
build:
runs-on: linux-amd64-docker-small
timeout-minutes: 35
container:
image: docker:29.1.3-cli
steps:
- name: Install checkout tools
shell: sh
run: apk add --no-cache bash git
- name: Check out the pushed commit
uses: builtin:checkout
with:
ref: ${{ gitea.sha }}
persist-credentials: false
- name: Build and test the image
shell: bash
env:
RELEASE_SHA: ${{ gitea.sha }}
run: |
set -euo pipefail
docker info --format '{{range .SecurityOptions}}{{println .}}{{end}}' | grep -Fx 'name=rootless'
image="autolibrary-web:${RELEASE_SHA}"
trap 'docker image rm "$image" >/dev/null || true' EXIT
docker build -t "$image" .
bash deploy/smoke-container.sh "$image"