Add .gitea/workflows/reskin.yaml
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
name: anubis-reskin
|
||||
on:
|
||||
schedule: [{ cron: '17 6 * * *' }]
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
UPSTREAM: TecharoHQ/anubis
|
||||
IMAGE: git.kernel.rip/sesh/anubis
|
||||
REGISTRY: git.kernel.rip
|
||||
|
||||
jobs:
|
||||
reskin:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Latest upstream tag
|
||||
id: up
|
||||
run: echo "tag=$(curl -fsSL https://api.github.com/repos/$UPSTREAM/releases/latest | jq -r .tag_name)" >>"$GITHUB_OUTPUT"
|
||||
|
||||
- uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ secrets.REG_USER }}
|
||||
password: ${{ secrets.REG_TOKEN }}
|
||||
|
||||
- name: Skip if already built
|
||||
id: check
|
||||
run: |
|
||||
docker manifest inspect "$IMAGE:${{ steps.up.outputs.tag }}" >/dev/null 2>&1 \
|
||||
&& echo "build=false" >>"$GITHUB_OUTPUT" \
|
||||
|| echo "build=true" >>"$GITHUB_OUTPUT"
|
||||
|
||||
- if: steps.check.outputs.build == 'true'
|
||||
uses: actions/checkout@v4 # overlay repo
|
||||
|
||||
- if: steps.check.outputs.build == 'true'
|
||||
uses: actions/checkout@v4
|
||||
with: { repository: "${{ env.UPSTREAM }}", ref: "${{ steps.up.outputs.tag }}", path: upstream }
|
||||
|
||||
- if: steps.check.outputs.build == 'true'
|
||||
name: Overlay + drift guard
|
||||
run: |
|
||||
for f in happy pensive reject; do
|
||||
test -f "upstream/web/static/img/$f.webp" || { echo "::error::missing $f.webp upstream"; exit 1; }
|
||||
done
|
||||
cp mascot/*.webp upstream/web/static/img/
|
||||
|
||||
- if: steps.check.outputs.build == 'true'
|
||||
working-directory: upstream
|
||||
run: |
|
||||
docker buildx create --use --name b 2>/dev/null || docker buildx use b
|
||||
docker buildx bake --print # run once to find the app target name
|
||||
docker buildx bake <target> \
|
||||
--set <target>.platform=linux/amd64 \
|
||||
--set <target>.tags="$IMAGE:${{ steps.up.outputs.tag }},$IMAGE:latest" \
|
||||
--push
|
||||
Reference in New Issue
Block a user