36 lines
961 B
YAML
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"
|