Files
promo_rathaus/.gitea/workflows/ci.yml
T
lukas 40f5e9c4c3
CI / test (push) Successful in 5m6s
CI / build (push) Successful in 4m44s
CI / deploy (push) Successful in 2s
✨ Update design
2026-09-02 07:43:28 +02:00

94 lines
2.3 KiB
YAML

name: CI
on:
push:
branches:
- main
- proof
workflow_dispatch:
env:
REGISTRY: git.lukas-harat.com
IMAGE_NAME: ${{ github.repository }}
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Typecheck
run: npx tsc --noEmit
build:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy to TrueNAS
env:
TRUENAS_URL: ${{ secrets.TRUENAS_URL }}
TRUENAS_API_KEY: ${{ secrets.TRUENAS_API_KEY }}
IMAGE_TAG: ${{ github.sha }}
run: |
set -euo pipefail
echo "Deploying image:"
echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${IMAGE_TAG}"
# TrueNAS API deployment goes here.
#
# IMPORTANT:
# The exact JSON-RPC request depends on your TrueNAS SCALE
# version and the name of your Custom App.
#
# TRUENAS_URL should look like:
# https://truenas.example.com
#
# TRUENAS_API_KEY should be a TrueNAS API key with permission
# to update the application.
echo "TrueNAS deployment configuration required."