Merge remote-tracking branch 'origin/setup-guide' into setup-guide #134
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
env: | |
GAR_LOCATION: ${{vars.GCLOUD_REGION}} | |
working-directory: ./backend | |
jobs: | |
docker-release: | |
name: Release to Google Artifact Registry | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') # only run when tagged commit is pushed | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
steps: | |
- id: checkout | |
name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Scala | |
uses: olafurpg/setup-scala@v10 | |
with: | |
java-version: "openjdk@1.17.0" | |
- id: auth | |
name: Authenticate with Google Cloud | |
uses: google-github-actions/auth@v2 | |
with: | |
token_format: access_token | |
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }} | |
service_account: ${{ secrets.SERVICE_ACCOUNT }} | |
access_token_lifetime: 600s | |
- name: Login to Artifact Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: europe-west6-docker.pkg.dev | |
username: oauth2accesstoken | |
password: ${{ steps.auth.outputs.access_token }} | |
- name: Get tag | |
id: get-tag | |
run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/} | |
- name: Get commons lib | |
run: sbt publishLocal | |
working-directory: ./backend/commons | |
- name: Build and Push Analysis Service | |
run: | | |
sbt assembly | |
docker build -t analysis:0.1.0 . | |
docker tag analysis:0.1.0 ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{vars.PROJECT_ID}}/ruettel-report/analysis:${{ steps.get-tag.outputs.short_ref }} | |
docker push ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{vars.PROJECT_ID}}/ruettel-report/analysis:${{ steps.get-tag.outputs.short_ref }} | |
working-directory: ./backend/Analysis | |
- name: Build Images | |
run: sbt docker:publishLocal | |
working-directory: ${{ env.working-directory }} | |
- id: docker-push-query-service-tagged | |
name: Tag QueryService Docker image and push to Google Artifact Registry | |
run: | | |
docker tag queryservice:0.1.0 ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{vars.PROJECT_ID}}/ruettel-report/queryservice:${{ steps.get-tag.outputs.short_ref }} | |
docker push ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{vars.PROJECT_ID}}/ruettel-report/queryservice:${{ steps.get-tag.outputs.short_ref }} | |
- id: docker-push-datatransformer-service-tagged | |
name: Tag DataTransformerService Docker image and push to Google Artifact Registry | |
run: | | |
docker tag datatransformerservice:0.1.0 ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{vars.PROJECT_ID}}/ruettel-report/datatransformerservice:${{ steps.get-tag.outputs.short_ref }} | |
docker push ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{vars.PROJECT_ID}}/ruettel-report/datatransformerservice:${{ steps.get-tag.outputs.short_ref }} | |
- id: docker-build-push-frontend-and-projectmanagement-service-tagged | |
name: Build,Tag Frontend and ProjectManagement Docker image and push to Google Artifact Registry | |
run: | | |
docker build . --tag ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{vars.PROJECT_ID}}/ruettel-report/frontend:${{ steps.get-tag.outputs.short_ref }} | |
docker push ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{vars.PROJECT_ID}}/ruettel-report/frontend:${{ steps.get-tag.outputs.short_ref }} | |
working-directory: ./frontend | |