diff --git a/.github/workflows/publish-docker-tag.yaml b/.github/workflows/publish-docker-tag.yaml new file mode 100644 index 0000000..1fb8dfb --- /dev/null +++ b/.github/workflows/publish-docker-tag.yaml @@ -0,0 +1,61 @@ +name: Publish Docker tag images + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +env: + DOCKER_REGISTRY: europe-docker.pkg.dev + DOCKER_IMAGE_SERVER_NAME: lks-lz-artifacts/docker-clientdiversity/blockprint-server + DOCKER_IMAGE_BACKGROUND_NAME: lks-lz-artifacts/docker-clientdiversity/blockprint-background + +jobs: + build-docker: + permissions: + contents: "read" + id-token: "write" + runs-on: ubuntu-latest + steps: + - name: Checkout ${{ inputs.sha }} + uses: actions/checkout@v2 + + - name: Setup buildx + uses: docker/setup-buildx-action@v2 + + - name: Authenticate to Google Cloud + id: gcpauth + uses: google-github-actions/auth@v1 + with: + create_credentials_file: "true" + workload_identity_provider: "projects/311968610280/locations/global/workloadIdentityPools/github/providers/github" + service_account: "artifact-deployer@lks-lz-management.iam.gserviceaccount.com" + + - name: login + run: |- + gcloud auth login --brief --cred-file="${{ steps.gcpauth.outputs.credentials_file_path }}" + gcloud auth configure-docker ${{ env.DOCKER_REGISTRY }} + + - name: Build and push Docker image (blockprint server) + uses: docker/build-push-action@v3 + with: + context: . + file: ./Dockerfile.server + push: true + build-args: | + GIT_TAG=${{ github.ref_name }} + tags: | + ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_SERVER_NAME }}:${{ github.ref_name }} + ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_SERVER_NAME }}:latest + + - name: Build and push Docker image (blockprint background tasks) + uses: docker/build-push-action@v3 + with: + context: . + file: ./Dockerfile.background + push: true + build-args: | + GIT_TAG=${{ github.ref_name }} + tags: | + ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BACKGROUND_NAME }}:${{ github.ref_name }} + ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BACKGROUND_NAME }}:latest