Creation backend #46
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: CD | |
on: push | |
env: | |
PROJECT_ID: shoodies-377210 | |
GAR_LOCATION: europe-west1 | |
REGION: europe-west1 | |
APP: shoodies | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: 'ubuntu-latest' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18.14 | |
- name: Install dependencies | |
run: npm ci | |
- name: Build backend | |
run: npm run build -w backend | |
- id: 'auth' | |
name: 'Authenticate to Google Cloud' | |
uses: 'google-github-actions/auth@v1' | |
with: | |
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}' | |
- name: 'Set up Cloud SDK' | |
uses: 'google-github-actions/setup-gcloud@v1' | |
with: | |
project_id: '${{ env.PROJECT_ID }}' | |
- name: 'Docker auth' | |
run: |- | |
gcloud auth configure-docker ${{ env.GAR_LOCATION }}-docker.pkg.dev | |
- name: 'Use gcloud CLI' | |
run: 'gcloud info' | |
- name: 'Build and push container 2' | |
run: |- | |
docker build -t "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{env.APP}}/${{env.APP}}:${{ github.sha }}" ./packages/backend | |
docker push "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{env.APP}}/${{env.APP}}:${{ github.sha }}" |