Skip to content

Commit

Permalink
Create manually triggerd action for deploy to production (#425)
Browse files Browse the repository at this point in the history
  • Loading branch information
iddanh authored Feb 15, 2024
1 parent 4482ee9 commit f9d1169
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/prod-ci-cd
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Production CI/CD
on:
workflow_dispatch:

jobs:
prod-ci-cd:
name: Production CI/CD
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 18
- run: npm ci
- run: npm run build -w backend
- run: npm run build -w client

# Setup gcloud CLI
- uses: 'google-github-actions/auth@v2'
with:
project_id: 'ezla-pickup'
service_account: 'ezla-github-builder@ezla-pickup.iam.gserviceaccount.com'
credentials_json: ${{ secrets.GCLOUD_SA_CREDS }}

- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 363.0.0'

- name: Configure Docker
run: |
gcloud auth configure-docker

# Build the Docker image
- name: Build & Publish
run: |
docker build . --tag 'gcr.io/ezla-pickup/ezer-lachaim/ezla:${{github.run_number}}'
docker push 'gcr.io/ezla-pickup/ezer-lachaim/ezla:${{github.run_number}}'

- name: deploy
uses: google-github-actions/deploy-cloudrun@v2
with:
service: api-hub
image: gcr.io/ezla-pickup/ezer-lachaim/ezla:${{github.run_number}}
region: us-east1

0 comments on commit f9d1169

Please sign in to comment.