mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-08-18 18:06:04 +00:00
56 lines
1.9 KiB
YAML
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:45babd1b4ce0349fb12c4e24bf017b90b96d52806db32e001e3013f341bef0fe
|
|
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:45babd1b4ce0349fb12c4e24bf017b90b96d52806db32e001e3013f341bef0fe
|
|
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
|