Files
palette/.gitea/workflows/ci.yml
T
poslop 518a4dc026
CI / test (push) Successful in 6s
CI / docker (push) Failing after 11s
CI: point docker job at dind sidecar via tcp DOCKER_HOST
2026-09-08 18:39:36 -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.GITEA_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