Files
palette/.gitea/workflows/ci.yml
T
poslop 11b7fcaa8b
CI / test (push) Successful in 7s
CI / docker (push) Successful in 36s
CI: use REGISTRY_TOKEN secret for registry login
2026-09-08 18:44:06 -05:00

59 lines
1.3 KiB
YAML

name: CI
on:
push:
branches: [main]
tags: ['v*']
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.27"
- name: Vet
run: go vet ./...
- name: Test
run: go test -v ./...
docker:
# build & push image only on tags (releases)
if: startsWith(github.ref, 'refs/tags/')
needs: test
runs-on: ubuntu-latest
env:
# dind sidecar listens on tcp; job containers reach it via the docker bridge gateway
DOCKER_HOST: tcp://172.17.0.1:2375
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Gitea registry
uses: docker/login-action@v3
with:
registry: git.archfox.org
username: ${{ gitea.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
git.archfox.org/poslop/palette:${{ gitea.ref_name }}
git.archfox.org/poslop/palette:latest
cache-from: type=gha
cache-to: type=gha,mode=max