Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name: 'Build and Publish'
on:
workflow_dispatch:

env:
GAR_LOCATION: ${{ secrets.GAR_LOCATION }}
GAR_PROJECT_ID: ${{ secrets.GAR_PROJECT_ID }}
GAR_REPOSITORY: ${{ secrets.GAR_REPOSITORY }}
IMAGE_NAME: server

jobs:
Build-Containers:
runs-on: ubuntu-latest
Expand All @@ -24,11 +30,19 @@ jobs:
cache: 'sbt'
- uses: sbt/setup-sbt@v1

- name: Login to registry
run: echo ${{ secrets.TOKEN }} | docker login --username oauth --password-stdin cr.yandex
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2

- name: Configure Docker for Google Artifact Registry
run: |
gcloud auth configure-docker ${GAR_LOCATION}-docker.pkg.dev

- name: Push image
- name: Build and push image
run: sbt pushImage
env:
SERVER_URL: ${{ secrets.SERVER_URL }}
REGISTRY: ${{ secrets.REGISTRY }}
env:
REGISTRY: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.GAR_PROJECT_ID }}/${{ env.GAR_REPOSITORY }}/${{ env.IMAGE_NAME }}