Files
palette/.gitea/workflows/ci.yml
T
poslop b1187e061f
CI / test (push) Successful in 19s
CI / docker (push) Failing after 30s
CI: install docker CLI in docker job (debian image lacks it)
2026-09-09 01:45:53 -05:00

65 lines
1.6 KiB
YAML

name: CI
on:
push:
branches: [main]
tags: ['v*']
pull_request:
jobs:
test:
runs-on: [debian-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: [debian-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: Install Docker CLI
run: |
apt-get update && apt-get install -y docker-cli || \
(curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-27.3.1.tgz -o /tmp/docker.tgz \
&& tar -xzf /tmp/docker.tgz -C /tmp && mv /tmp/docker/docker /usr/local/bin/docker)
- 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