2024-10-29 15:01:35 -03:00
|
|
|
name: "CI"
|
2024-04-28 14:24:50 -04:00
|
|
|
|
|
|
|
on:
|
2024-10-29 15:01:35 -03:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs: {}
|
2024-04-28 14:24:50 -04:00
|
|
|
push:
|
|
|
|
branches: ["*"]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: runner
|
2024-10-29 15:01:35 -03:00
|
|
|
|
2024-04-28 14:24:50 -04:00
|
|
|
steps:
|
2024-10-29 15:01:35 -03:00
|
|
|
- name: Checkout repo
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
2024-12-21 00:59:12 -03:00
|
|
|
# - name: Set up QEMU for ARM64 builds
|
|
|
|
# uses: docker/setup-qemu-action@v3
|
|
|
|
# with:
|
|
|
|
# platforms: arm64
|
2024-10-29 15:01:35 -03:00
|
|
|
|
2024-11-05 17:57:58 -03:00
|
|
|
- name: Cache Go packages
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cache/go-build
|
|
|
|
~/go/pkg/mod
|
|
|
|
key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-golang-
|
|
|
|
|
2024-10-29 15:01:35 -03:00
|
|
|
- name: Setup Docker BuildX system
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
|
|
|
- name: Login to Docker Container Registry (git.nadeko.net)
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
registry: git.nadeko.net
|
|
|
|
username: ${{ secrets.USERNAME }}
|
|
|
|
password: ${{ secrets.TOKEN }}
|
|
|
|
|
|
|
|
- name: Docker meta
|
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v5
|
|
|
|
with:
|
|
|
|
images: git.nadeko.net/fijxu/http3-ytproxy
|
|
|
|
tags: |
|
|
|
|
type=sha,format=short,prefix={{date 'YYYY.MM.DD'}}-,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
|
|
|
|
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
|
2024-04-28 14:24:50 -04:00
|
|
|
|
2024-10-29 15:01:35 -03:00
|
|
|
- name: Build and push Docker AMD64/ARM64
|
2024-11-05 17:57:58 -03:00
|
|
|
uses: docker/build-push-action@v6
|
2024-10-29 15:01:35 -03:00
|
|
|
with:
|
|
|
|
context: .
|
2024-12-21 00:59:12 -03:00
|
|
|
platforms: linux/amd64
|
|
|
|
# platforms: linux/amd64,linux/arm64/v8
|
2024-10-29 15:01:35 -03:00
|
|
|
push: true
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|