diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..ba17e15 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,54 @@ +name: Build and Deploy + +on: + workflow_dispatch: + push: + branches: + - main + - EI-540 + +env: + REGISTRY: europe-west4-docker.pkg.dev + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + + steps: + - uses: actions/checkout@v4 + +# - name: Docker meta +# id: meta +# uses: docker/metadata-action@v5 +# with: +# images: p2p-ssv-cluster-manager/main +# tags: | +# type=sha,priority=300 +# + - name: Build Image + id: build-image + uses: redhat-actions/buildah-build@v2 + with: + image: p2p-ssv-cluster-manager/main + context: . + tags: sha-${{ github.sha }} + containerfiles: | + ./Dockerfile + + - uses: 'google-github-actions/auth@v2' + id: auth + with: + project_id: iaas-383414 + workload_identity_provider: projects/802839937832/locations/global/workloadIdentityPools/iaas-pipelines-iaas/providers/github-all-p2p-org-repos + + - name: Push to Artifact Registry + uses: redhat-actions/push-to-registry@v2 + with: + image: ${{ steps.build-image.outputs.image }} + tags: ${{ steps.build-image.outputs.tags }} + registry: ${{ env.REGISTRY }} + username: oauth2accesstoken + password: "${{ steps.auth.outputs.auth_token }}"