Files
git-pages/.forgejo/workflows/ci.yaml
T
Catherine c93bc3a250 CI: run on all branches, but package only on main branch.
This is required for Renovate to work properly.
2025-10-26 05:02:01 +00:00

56 lines
1.9 KiB
YAML

name: CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
check:
runs-on: codeberg-small-lazy
container:
image: docker.io/library/node:24-trixie-slim@sha256:4fd2d8b0c63882882529a56bcc977732c059e0d03a977eb20d504d9a1d6591a0
steps:
- name: Check out source code
uses: https://code.forgejo.org/actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- name: Set up toolchain
uses: https://code.forgejo.org/actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6
with:
go-version: '>=1.25.0'
- name: Install dependencies
run: |
apt-get -y update
apt-get -y install ca-certificates
- name: Build service
run: |
go build -o bin/git-pages .
- name: Run static analysis
run: |
go vet .
package:
if: ${{ forge.ref == 'refs/heads/main' }}
needs: [check]
runs-on: codeberg-small-lazy
container:
image: docker.io/library/node:24-trixie-slim@sha256:4fd2d8b0c63882882529a56bcc977732c059e0d03a977eb20d504d9a1d6591a0
steps:
- name: Install dependencies
run: |
apt-get -y update
apt-get -y install buildah ca-certificates
- name: Check out source code
uses: https://code.forgejo.org/actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- if: ${{ forge.repository == 'git-pages/git-pages' && 'true' || 'false' }}
name: Log into container registry
run: |
buildah login --authfile=/tmp/authfile.json \
-u git-pages-bot -p ${{ secrets.PACKAGES_TOKEN }} codeberg.org
- name: Build container
uses: https://codeberg.org/actions/buildah-simple@main
with:
context: .
tag: "codeberg.org/git-pages/git-pages:latest"
push: ${{ forge.repository == 'git-pages/git-pages' && 'true' || 'false' }}
authfile: /tmp/authfile.json