2026-03-01 21:03:37 +01:00
|
|
|
name: Build and Push Docker Image
|
2026-05-10 02:30:08 +02:00
|
|
|
|
2026-03-01 21:03:37 +01:00
|
|
|
on:
|
|
|
|
|
push:
|
|
|
|
|
branches: [main]
|
2026-05-10 02:30:08 +02:00
|
|
|
paths:
|
|
|
|
|
- 'content/**'
|
|
|
|
|
- 'static/**'
|
|
|
|
|
- 'templates/**'
|
|
|
|
|
- 'themes/**'
|
|
|
|
|
- 'config.toml'
|
|
|
|
|
- 'docker/Dockerfile'
|
|
|
|
|
- 'docker/nginx.conf'
|
|
|
|
|
- '.forgejo/workflows/build.yml'
|
|
|
|
|
tags: ['v*']
|
2026-03-01 21:03:37 +01:00
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
build:
|
|
|
|
|
runs-on: docker
|
|
|
|
|
container:
|
2026-03-01 21:09:26 +01:00
|
|
|
image: catthehacker/ubuntu:act-latest
|
2026-05-10 02:30:08 +02:00
|
|
|
|
2026-03-01 21:03:37 +01:00
|
|
|
steps:
|
|
|
|
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
|
|
|
|
with:
|
|
|
|
|
submodules: true
|
|
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
|
|
|
|
uses: https://data.forgejo.org/docker/setup-qemu-action@v3
|
|
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
|
uses: https://data.forgejo.org/docker/setup-buildx-action@v3
|
|
|
|
|
|
|
|
|
|
- name: Login to Forgejo Registry
|
|
|
|
|
uses: https://data.forgejo.org/docker/login-action@v3
|
|
|
|
|
with:
|
|
|
|
|
registry: forge.lvl0.xyz
|
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
|
|
2026-05-10 02:30:08 +02:00
|
|
|
- name: Determine tags
|
|
|
|
|
id: meta
|
|
|
|
|
run: |
|
|
|
|
|
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
|
|
|
|
|
TAG="${{ github.ref_name }}"
|
|
|
|
|
echo "tags=forge.lvl0.xyz/lvl0/lvl0-website:${TAG},forge.lvl0.xyz/lvl0/lvl0-website:latest" >> $GITHUB_OUTPUT
|
|
|
|
|
else
|
|
|
|
|
echo "tags=forge.lvl0.xyz/lvl0/lvl0-website:latest" >> $GITHUB_OUTPUT
|
|
|
|
|
fi
|
|
|
|
|
|
2026-03-01 21:03:37 +01:00
|
|
|
- name: Build and push
|
|
|
|
|
uses: https://data.forgejo.org/docker/build-push-action@v5
|
|
|
|
|
with:
|
|
|
|
|
context: .
|
2026-05-10 02:30:08 +02:00
|
|
|
file: docker/Dockerfile
|
2026-03-01 21:03:37 +01:00
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
|
push: true
|
2026-05-10 02:30:08 +02:00
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|