Skip to content

Commit dc4060c

Browse files
committed
fix: release action
fix: app name fix: replaced - to _ fix: replace all fix: push image fix: replace function fix: replace all fix: cloud run environments
1 parent e788d91 commit dc4060c

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.github/workflows/cloud-run.yaml

+11-6
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,26 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
app: ["transaction_service", "analytics_service", "block_info_service", "user_service", "contract_service"]
16+
app: ["contract_service"]
1717
steps:
1818
- uses: actions/checkout@v2
1919
- name: Login to GCP
20-
uses: google-github-actions/setup-gcloud@v0
20+
uses: google-github-actions/auth@v0
2121
with:
22-
project_id: ${{ secrets.GCP_PROJECT_ID }}
23-
service_account_email: ${{ secrets.GCP_EMAIL }}
24-
service_account_key: ${{ secrets.GCP_CREDENTIALS }}
22+
credentials_json: ${{ secrets.GCP_CREDENTIALS }}
2523
- name: Configure Docker for GCP
2624
run: gcloud auth configure-docker --quiet
2725
- name: Pull image from GCR
2826
run: docker pull ghcr.io/${{ github.repository }}/${{ matrix.app }}:${{ github.event.inputs.tag }}
2927
- name: Tag image for GCR
3028
run: docker tag ghcr.io/${{ github.repository }}/${{ matrix.app }}:${{ github.event.inputs.tag }} gcr.io/${{ secrets.GCP_PROJECT_ID }}/${{ matrix.app }}:${{ github.event.inputs.tag }}
29+
- uses: frabert/replace-string-action@v2.0
30+
id: runner
31+
with:
32+
pattern: '_'
33+
string: ${{matrix.app}}
34+
replace-with: '-'
35+
flags: "g"
3136
- name: Deploy cloud run
32-
run: gcloud run deploy ${{ secrets.GCP_PROJECT_ID }} --image gcr.io/${{ secrets.GCP_PROJECT_ID }}/${{ matrix.app }}:${{ github.event.inputs.tag }} --region asia-southeast1 --platform managed
37+
run: gcloud run deploy ${{steps.runner.outputs.replaced}} --image gcr.io/${{ secrets.GCP_PROJECT_ID }}/${{ matrix.app }}:${{ github.event.inputs.tag }} --region asia-southeast1 --platform managed --set-env-vars=DATABASE_URL=${{secrets.DATABASE_TEST_URL}},JWT_SECRET=${{secrets.JWT_SECRET}}
3338

0 commit comments

Comments
 (0)