name: Docker Build and Push on: push: branches: - main - staging jobs: build-and-push: runs-on: gitea/runner-images:ubuntu-latest strategy: matrix: arch: [amd64, arm64] steps: - name: Checkout repository uses: actions/checkout@v4 - 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: 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: Push Multi-arch Manifest for staging if: github.ref == 'refs/heads/staging' uses: docker/build-push-action@v6 with: push: true tags: git.fossy.my.id/${{ secrets.DOCKER_USERNAME }}/tunnl_please:staging manifests: | git.fossy.my.id/${{ secrets.DOCKER_USERNAME }}/tunnl_please:amd64 git.fossy.my.id/${{ secrets.DOCKER_USERNAME }}/tunnl_please:arm64