4dcd1f943b
Gitea's cache server is unreachable, causing setup-go to block on a failed cache restore. Disable it since the Docker build layer caches dependencies independently. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
name: build-and-push
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.23'
|
|
cache: false
|
|
- name: Run tests
|
|
run: go test ./...
|
|
- name: Vet
|
|
run: go vet ./...
|
|
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Log in to Gitea Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: gitea.thewrightserver.net
|
|
username: josh
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
- name: Build and push image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: deploy/Dockerfile
|
|
push: true
|
|
tags: |
|
|
gitea.thewrightserver.net/josh/provisioning:latest
|
|
gitea.thewrightserver.net/josh/provisioning:${{ github.sha }}
|