name: Build and Push Worker on: push: branches: ["*"] tags: ["v*"] pull_request: branches: [main] env: REGISTRY: git.zias.be OWNER: zias jobs: build-worker: runs-on: ubuntu-latest timeout-minutes: 360 steps: - uses: actions/checkout@v4 - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 with: driver: docker - name: Log in to registry if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ env.OWNER }} password: ${{ secrets.REGISTRY_TOKEN }} - name: Extract metadata id: meta uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.OWNER }}/openpanel-worker tags: | type=raw,value=latest,enable={{is_default_branch}} type=sha,prefix=sha-,format=short type=semver,pattern={{version}} - name: Build image uses: docker/build-push-action@v6 with: context: . file: apps/worker/Dockerfile target: runner platforms: linux/amd64 push: false load: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} provenance: false build-args: |- DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres - name: Push image if: github.event_name != 'pull_request' run: |- while IFS= read -r tag; do [ -n "$tag" ] && docker push "$tag" done <<< "${{ steps.meta.outputs.tags }}"