Skip to content

Commit

Permalink
Add CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolmin committed Sep 24, 2024
1 parent f226217 commit 2a1b2cd
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/publish-docker-tag.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2a1b2cd

Please sign in to comment.