File tree Expand file tree Collapse file tree 4 files changed +25
-18
lines changed
Expand file tree Collapse file tree 4 files changed +25
-18
lines changed Original file line number Diff line number Diff line change 33name : Deploy
44
55on :
6+ workflow_dispatch :
67 push :
78 branches : develop
89
@@ -38,18 +39,18 @@ jobs:
3839 uses : docker/build-push-action@v6
3940 with :
4041 push : true
41- tags : us-central1-docker.pkg.dev/api-tools-451421/runners/daily-update-events
42+ tags : us-central1-docker.pkg.dev/api-tools-451421/runners/runner
4243
43- - name : Upload to dev job
44+ - name : Upload to daily dev job
4445 uses : google-github-actions/deploy-cloudrun@v2
4546 with :
46- job : ' daily-update-events- dev'
47- image : ' us-central1-docker.pkg.dev/api-tools-451421/runners/daily-update-events '
47+ job : ' daily-dev'
48+ image : ' us-central1-docker.pkg.dev/api-tools-451421/runners/runner '
4849 region : us-central1
4950
50- - name : Upload to prod job
51+ - name : Upload to daily prod job
5152 uses : google-github-actions/deploy-cloudrun@v2
5253 with :
53- job : ' daily-update-events- prod'
54- image : ' us-central1-docker.pkg.dev/api-tools-451421/runners/daily-update-events '
54+ job : ' daily-prod'
55+ image : ' us-central1-docker.pkg.dev/api-tools-451421/runners/runner '
5556 region : us-central1
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ ENV GOOGLE_CHROME_BIN /usr/bin/chromium # Also set this for compatibility
2525
2626# Copy build file from builder
2727COPY --from=builder /app/api-tools /app/api-tools
28- COPY deploy.sh /app/deploy.sh
28+ COPY runners /app/runners
2929
30- RUN chmod +x /app/deploy .sh
31- ENTRYPOINT ["/app/deploy .sh" ]
30+ RUN chmod +x /app/runners/setup .sh
31+ ENTRYPOINT ["/app/runners/setup .sh" ]
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ # for daily tasks to run
4+
5+ # scrape, parse, and upload events
6+ ./api-tools -scrape -mazevo -verbose
7+ ./api-tools -parse -mazevo -verbose
8+ ./api-tools -scrape -astra -verbose
9+ ./api-tools -parse -astra -verbose
10+ ./api-tools -upload -events -verbose
Original file line number Diff line number Diff line change 11#! /bin/sh
22
3- # service account
3+ # auth with service account
44gcloud secrets versions access latest --secret=" $SERVICE_ACCOUNT_SECRET_NAME " > service_account.json
55gcloud auth activate-service-account --key-file=service_account.json
66rm service_account.json
77
8- # .env
8+ # use service account to access environment variables from GCP secrets, create .env
99gcloud secrets versions access latest --secret=" $ENV_SECRET_NAME " > .env
1010
11- # Scrape, parse, and upload
12- ./api-tools -scrape -mazevo -verbose
13- ./api-tools -parse -mazevo -verbose
14- ./api-tools -scrape -astra -verbose
15- ./api-tools -parse -astra -verbose
16- ./api-tools -upload -events -verbose
11+ # run commands from the file path specified in the GCP run job's variable
12+ sh " /app/runners/$RUNNER_SCRIPT_NAME "
You can’t perform that action at this time.
0 commit comments