Update .gitea/workflows/build.yml
This commit is contained in:
@ -8,42 +8,61 @@ on:
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on:
|
||||
- linux
|
||||
- ${{ matrix.arch }}
|
||||
container:
|
||||
image: docker.gitea.com/runner-images:ubuntu-latest
|
||||
runs-on: gitea/runner-images:ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [amd64, arm64]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- uses: docker/login-action@v3
|
||||
- name: Log in to Docker registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.fossy.my.id
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build & Push (main)
|
||||
if: github.ref == 'refs/heads/main'
|
||||
- name: Build and Push per-arch
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: git.fossy.my.id/${{ secrets.DOCKER_USERNAME }}/tunnl_please:${{ matrix.arch }}
|
||||
platforms: linux/${{ matrix.arch }}
|
||||
|
||||
multi-arch-manifest:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build-and-push
|
||||
steps:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to Docker registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.fossy.my.id
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Push Multi-arch Manifest for main
|
||||
if: github.ref == 'refs/heads/main'
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
tags: git.fossy.my.id/${{ secrets.DOCKER_USERNAME }}/tunnl_please:latest
|
||||
manifests: |
|
||||
git.fossy.my.id/${{ secrets.DOCKER_USERNAME }}/tunnl_please:amd64
|
||||
git.fossy.my.id/${{ secrets.DOCKER_USERNAME }}/tunnl_please:arm64
|
||||
|
||||
- name: Build & Push (staging)
|
||||
- name: Push Multi-arch Manifest for staging
|
||||
if: github.ref == 'refs/heads/staging'
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: git.fossy.my.id/${{ secrets.DOCKER_USERNAME }}/tunnl_please:staging
|
||||
manifests: |
|
||||
|
||||
Reference in New Issue
Block a user