create docker image
All checks were successful
Generic zig build / build (push) Successful in 1m41s
Generic zig build / deploy (push) Successful in 22s

This commit is contained in:
Emil Lerch 2026-04-18 12:41:22 -07:00
parent 249b5ec2c4
commit 58d1d8ea0a
Signed by: lobo
GPG key ID: A7B62D657EF764F8
3 changed files with 7273 additions and 0 deletions

View file

@ -4,6 +4,10 @@ on:
push:
branches:
- '*'
env:
BUILD_TARGET: x86_64-linux-musl
BUILD_OPTIMIZATION: ReleaseSafe
BINARY_NAME: zfin
jobs:
build:
runs-on: ubuntu-latest
@ -16,6 +20,13 @@ jobs:
run: zig build --summary all
- name: Run tests
run: zig build test --summary all
- name: Package
run: zig build -Dtarget="$BUILD_TARGET" -Doptimize="$BUILD_OPTIMIZATION"
- name: Upload
uses: actions/upload-artifact@v3
with:
name: ${{ env.BINARY_NAME }}
path: zig-out/bin/${{ env.BINARY_NAME }}
- name: Notify
uses: https://git.lerch.org/lobo/action-notify-ntfy@v2
if: always() && env.GITEA_ACTIONS == 'true'
@ -25,3 +36,44 @@ jobs:
status: ${{ job.status }}
user: ${{ secrets.NTFY_USER }}
password: ${{ secrets.NTFY_PASSWORD }}
deploy:
runs-on: ubuntu-latest
container:
image: ghcr.io/catthehacker/ubuntu:act-22.04
needs: build
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.BINARY_NAME }}
- name: "Make executable actually executable"
run: chmod 755 ${{ env.BINARY_NAME }} && mv ${{ env.BINARY_NAME }} docker
- name: Get short ref
id: vars
run: echo "shortsha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
-
name: Login to Gitea
uses: docker/login-action@v2
with:
registry: git.lerch.org
username: ${{ github.actor }}
password: ${{ secrets.PACKAGE_PUSH }}
-
name: Build and push
uses: docker/build-push-action@v6
with:
context: docker
push: true
tags: |
git.lerch.org/${{ github.repository }}:${{ steps.vars.outputs.shortsha }}
git.lerch.org/${{ github.repository }}:latest
- name: Notify
uses: https://git.lerch.org/lobo/action-notify-ntfy@v2
if: always()
with:
host: ${{ secrets.NTFY_HOST }}
topic: ${{ secrets.NTFY_TOPIC }}
user: ${{ secrets.NTFY_USER }}
password: ${{ secrets.NTFY_PASSWORD }}

7
docker/Dockerfile Normal file
View file

@ -0,0 +1,7 @@
FROM scratch
COPY ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY zfin /zfin
ENV ZFIN_HOME=/data
ENV ZFIN_CACHE_DIR=/cache
WORKDIR /data
ENTRYPOINT ["/zfin"]

7214
docker/ca-certificates.crt Normal file

File diff suppressed because it is too large Load diff