Skip to content

Build and Push to Artifact Registry #3

Build and Push to Artifact Registry

Build and Push to Artifact Registry #3

name: Build and Push to Artifact Registry
on:
workflow_dispatch
env:
PROJECT_ID: cs3219-400714
REGION: asia-southeast1
GAR_LOCATION: asia-southeast1-docker.pkg.dev/cs3219-400714/peerprep/
jobs:
build-push-artifact:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: 'Create env file'
run: |
echo "${{ secrets.ENV_FILE }}" > .env
- id: "auth"
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.SERVICE_ACCOUNT_KEY }}"
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v1"
- name: "Use gcloud CLI"
run: "gcloud info"
- name: "Docker auth"
run: |-
gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev --quiet
- name: Build image
run: docker-compose build
- name: Push image
run: docker-compose push