package updates 2024-12-09 #6
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
# This workflow will build a docker container and publish it to Google Container Registry | |
name: Production build and publish | |
on: | |
push: | |
branches: | |
- master | |
env: | |
REGISTRY_HOSTNAME: eu.gcr.io | |
GKE_PROJECT: ${{ secrets.GKE_PROJECT }} | |
GITHUB_SHA: ${{ github.sha }} | |
jobs: | |
backend: | |
name: build and publish backend | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- id: auth | |
uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: ${{ secrets.GKE_KEY }} | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v2 | |
- name: Setup docker gcloud auth | |
run: | | |
# configure docker to authenticate via gcloud command-line tool | |
gcloud auth configure-docker | |
- name: Build backend docker image | |
run: | | |
docker build -t "$REGISTRY_HOSTNAME"/"$GKE_PROJECT"/maguire-backend:"$GITHUB_SHA" backend | |
- name: Publish backend docker image | |
run: | | |
docker push $REGISTRY_HOSTNAME/$GKE_PROJECT/maguire-backend:$GITHUB_SHA |