* chore: multi-arch Docker build (amd64, arm64, armv7) - Remove hardcoded GOARCH=amd64 from Dockerfile, use TARGETARCH ARG - Add QEMU + buildx to CI for cross-compilation - Build for linux/amd64, linux/arm64, linux/arm/v7 * chore: update action versions, add dependabot - actions/checkout v4 → v6 - actions/setup-go v5 → v6 - Add dependabot.yml (monthly checks for Go, Actions, Docker)
51 lines
1.0 KiB
YAML
51 lines
1.0 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Run tests
|
|
run: go test ./... -v -count=1
|
|
|
|
- name: Build
|
|
run: go build ./...
|
|
|
|
docker:
|
|
needs: test
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: docker/setup-qemu-action@v3
|
|
|
|
- uses: docker/setup-buildx-action@v3
|
|
|
|
- uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
|
tags: ghcr.io/turbootzz/vaultwarden-api:latest
|