From 6ddc2baad625a7f9c5119fee520479d584df78fe Mon Sep 17 00:00:00 2001 From: bagas Date: Wed, 3 Dec 2025 21:47:03 +0700 Subject: [PATCH] update: native builder for action --- .gitea/workflows/build.yml | 40 ++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index aa4d52a..cd54547 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -8,38 +8,36 @@ on: jobs: build-and-push: - runs-on: ubuntu-latest + runs-on: [linux, ${{ matrix.arch }}] + strategy: + matrix: + arch: [amd64, arm64] steps: - - name: Checkout repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + - uses: docker/setup-buildx-action@v3 - - name: Log in to Docker Hub - uses: docker/login-action@v3 + - uses: docker/login-action@v3 with: registry: git.fossy.my.id username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: Build and push Docker image for main - uses: docker/build-push-action@v6 - with: - context: . - push: true - tags: | - git.fossy.my.id/${{ secrets.DOCKER_USERNAME }}/tunnl_please:latest - platforms: linux/amd64,linux/arm64 + - name: Build & Push (main) if: github.ref == 'refs/heads/main' - - - name: Build and push Docker image for staging uses: docker/build-push-action@v6 with: context: . push: true - tags: | - git.fossy.my.id/${{ secrets.DOCKER_USERNAME }}/tunnl_please:staging - platforms: linux/amd64,linux/arm64 - if: github.ref == 'refs/heads/staging' \ No newline at end of file + tags: git.fossy.my.id/${{ secrets.DOCKER_USERNAME }}/tunnl_please:${{ matrix.arch }} + platforms: linux/${{ matrix.arch }} + + - name: Build & Push (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-${{ matrix.arch }} + platforms: linux/${{ matrix.arch }}