newchanges-3 #16
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: Maven Deploy | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- new2 # Trigger the workflow on pushes to the main branch | ||
jobs: | ||
deploy: | ||
name: Deploy to Maven Repository | ||
runs-on: ubuntu-latest | ||
env: | ||
GCP_SERVICE_ACCOUNT_KEY: ${{ env.GCP_SERVICE_ACCOUNT_KEY }} # Define the environment variable here | ||
Check failure on line 15 in .github/workflows/main.yml GitHub Actions / Maven DeployInvalid workflow file
|
||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
- name: build | ||
run: docker build -t us-central1-docker.pkg.dev/studentbase-v1/studentbase/backend:latest . | ||
- name: Decode and write GCP service account key to file | ||
run: | | ||
echo "$GCP_SERVICE_ACCOUNT_KEY" > /home/runner/gcloud-key.json | ||
echo "$GCP_SERVICE_ACCOUNT_KEY" | ||
cat /home/runner/gcloud-key.json | ||
shell: /usr/bin/bash -e {0} | ||
- name: auth | ||
run: gcloud auth activate-service-account [email protected] --key-file=/home/runner/gcloud-key.json --project=studentbase-v1 | ||
- name: push | ||
run: docker push us-central1-docker.pkg.dev/studentbase-v1/studentbase/backend:latest | ||
- name: deploy | ||
run: kubectl apply -f ./scripts/deploy.yml | ||