Name all steps in CI and CD workflows

This commit is contained in:
saadi 2023-04-04 10:26:38 +02:00
parent d022a5713b
commit d360279695
2 changed files with 24 additions and 12 deletions

View file

@ -12,15 +12,18 @@ jobs:
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' }}
steps:
- uses: google-github-actions/auth@v1
- name: Authenticate with Google Cloud
uses: google-github-actions/auth@v1
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- uses: google-github-actions/setup-gcloud@v1
- name: Setup gcloud CLI
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
- run: |
- name: Deploy app to Cloud Run
run: |
gcloud run deploy my-finance-pal \
--image=${{ secrets.GCP_REGION }}-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/cloud-run-source-deploy/my-finance-pal:${{ github.sha }} \
--allow-unauthenticated \

View file

@ -11,17 +11,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- run: yarn install
- name: Install dependencies
run: yarn install
- run: yarn build
- name: Build application
run: yarn build
- run: yarn test
- name: Run tests
run: yarn test
cloud_build:
needs: build_and_test
@ -29,17 +34,21 @@ jobs:
if: ${{ github.event_name == 'push' }}
steps:
- uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3
- uses: google-github-actions/auth@v1
- name: Authenticate with Google Cloud
uses: google-github-actions/auth@v1
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- uses: google-github-actions/setup-gcloud@v1
- name: Setup gcloud CLI
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
- run: |
- name: Submit job to Cloud Build
run: |
gcloud builds submit \
--region=${{ secrets.GCP_REGION }} \
--config cloudbuild.yaml \