Merge pull request #135 from GeeksHacking/feature/rating #34
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: Cloud Run Deployment | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
deploy: | |
name: Deployment | |
runs-on: ubuntu-latest | |
env: | |
IMAGE_NAME: gcr.io/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_APP_NAME }} | |
steps: | |
- name: Login | |
uses: google-github-actions/setup-gcloud@v0 | |
with: | |
project_id: ${{ secrets.GCP_PROJECT_ID }} | |
service_account_email: ${{ secrets.GCP_EMAIL }} | |
service_account_key: ${{ secrets.GCP_CREDENTIALS }} | |
- name: Configure Project | |
run: gcloud config set project ${{ secrets.GCP_PROJECT_ID }} | |
- name: Configure Docker | |
run: gcloud auth configure-docker --quiet | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Inject .env File | |
run: | | |
echo "${{ secrets.BACKEND_ENV }}" >> .env | |
- name: Build Docker image | |
run: docker build . -t ${{ secrets.GCR_REPO }} | |
- name: Push Docker image | |
run: docker push ${{ secrets.GCR_REPO }} | |
- name: Deploy Docker image | |
run: gcloud run deploy projmatch-main --image ${{ secrets.GCR_REPO }} --region asia-east1 --platform managed |