ai: yolo the CI and docker image create/push
This commit is contained in:
parent
1c3bb524c5
commit
c8479d6850
4 changed files with 7304 additions and 3 deletions
79
.forgejo/workflows/zig-build.yaml
Normal file
79
.forgejo/workflows/zig-build.yaml
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
name: Generic zig build
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- '*'
|
||||
env:
|
||||
BUILD_TARGET: x86_64-linux-musl
|
||||
BUILD_OPTIMIZATION: ReleaseSafe
|
||||
BINARY_NAME: zfin-server
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Zig
|
||||
uses: https://codeberg.org/mlugg/setup-zig@v2.2.1
|
||||
- name: Build project
|
||||
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'
|
||||
with:
|
||||
host: ${{ secrets.NTFY_HOST }}
|
||||
topic: ${{ secrets.NTFY_TOPIC }}
|
||||
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 }}
|
||||
|
|
@ -9,12 +9,13 @@
|
|||
"src",
|
||||
},
|
||||
.dependencies = .{
|
||||
.zfin = .{
|
||||
.path = "../zfin",
|
||||
},
|
||||
.httpz = .{
|
||||
.url = "git+https://github.com/karlseguin/http.zig#844f8016e6616f00b05d4cc3c713307b0fe586c7",
|
||||
.hash = "httpz-0.0.0-PNVzrBtMBwAPcQx3mNEgat3Xbsynw-eIC9SmOX5M9XtP",
|
||||
},
|
||||
.zfin = .{
|
||||
.url = "git+https://git.lerch.org/lobo/zfin.git#d25d6acb9b9643e47257f61b489f5fa7fbbac7f3",
|
||||
.hash = "zfin-0.0.0-J-B21qPuCgDINNDuVwrUiIyzh1i-H8yv1ySdbCMAishl",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
7
docker/Dockerfile
Normal file
7
docker/Dockerfile
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
FROM scratch
|
||||
COPY ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||
COPY zfin-server /zfin-server
|
||||
ENV HOME=/home/zfin-server
|
||||
USER 1000:1000
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["/zfin-server", "serve"]
|
||||
7214
docker/ca-certificates.crt
Normal file
7214
docker/ca-certificates.crt
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue