1
0
Fork 0
anubis-patches-nyx/.forgejo/workflows/docker.yml
2025-03-30 01:06:54 -03:00

79 lines
2 KiB
YAML

name: Docker image builds
on:
workflow_dispatch:
push:
branches: ["master"]
env:
DOCKER_METADATA_SET_OUTPUT_ENV: "true"
# permissions:
# contents: read
# packages: write
# attestations: write
# id-token: write
# pull-requests: write
jobs:
build:
runs-on: runner
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 0
submodules: "recursive"
- name: Patch anubis
run: |
cd ./anubis
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
git am ../patches/*.patch || exit 1
- name: Install required package
run: |
sudo apt-get update -y
sudo apt-get install -y --no-install-recommends brotli esbuild
- name: Setup Go
uses: https://github.com/actions/setup-go@v5
with:
go-version: '>=1.24.0'
- name: Setup Ko
run: |
curl -sSfL "https://github.com/ko-build/ko/releases/download/v0.17.1/ko_0.17.1_Linux_x86_64.tar.gz" > ko.tar.gz
sudo tar xzf ko.tar.gz -C /usr/local/bin ko
- name: Log into registry
uses: docker/login-action@v3
with:
registry: git.nadeko.net
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: git.nadeko.net/fijxu/anubis
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
type=sha,prefix={{branch}}-
- name: Build and push
id: build
run: |
cd ./anubis
npm ci
npm run container
env:
DOCKER_REPO: git.nadeko.net/fijxu/anubis
SLOG_LEVEL: debug