File tree Expand file tree Collapse file tree 4 files changed +18
-17
lines changed
Expand file tree Collapse file tree 4 files changed +18
-17
lines changed Original file line number Diff line number Diff line change @@ -39,19 +39,18 @@ jobs:
3939 uses : docker/build-push-action@v6
4040 with :
4141 push : true
42- tags : us-central1-docker.pkg.dev/api-tools-451421/runners/daily
43- build-args : RUN_SCRIPT_PATH=runners/daily.sh
42+ tags : us-central1-docker.pkg.dev/api-tools-451421/runners/runner
4443
4544 - name : Upload to dev job
4645 uses : google-github-actions/deploy-cloudrun@v2
4746 with :
4847 job : ' daily-dev'
49- image : ' us-central1-docker.pkg.dev/api-tools-451421/runners/daily '
48+ image : ' us-central1-docker.pkg.dev/api-tools-451421/runners/runner '
5049 region : us-central1
5150
5251 - name : Upload to prod job
5352 uses : google-github-actions/deploy-cloudrun@v2
5453 with :
5554 job : ' daily-prod'
56- image : ' us-central1-docker.pkg.dev/api-tools-451421/runners/daily '
55+ image : ' us-central1-docker.pkg.dev/api-tools-451421/runners/runner '
5756 region : us-central1
Original file line number Diff line number Diff line change 11FROM golang:1.23 AS builder
22
3- ARG RUN_SCRIPT_PATH
4-
53WORKDIR /app
64COPY . .
75
@@ -27,7 +25,7 @@ ENV GOOGLE_CHROME_BIN /usr/bin/chromium # Also set this for compatibility
2725
2826# Copy build file from builder
2927COPY --from=builder /app/api-tools /app/api-tools
30- COPY $RUN_SCRIPT_PATH /app/$RUN_SCRIPT_PATH
28+ COPY runners /app/runners
3129
32- RUN chmod +x /app/$RUN_SCRIPT_PATH
33- ENTRYPOINT ["/app/$RUN_SCRIPT_PATH " ]
30+ RUN chmod +x /app/runners/setup.sh
31+ ENTRYPOINT ["/app/runners/setup.sh " ]
Original file line number Diff line number Diff line change 11#! /bin/sh
22
3- # service account
4- gcloud secrets versions access latest --secret=" $SERVICE_ACCOUNT_SECRET_NAME " > service_account.json
5- gcloud auth activate-service-account --key-file=service_account.json
6- rm service_account.json
7-
8- # .env
9- gcloud secrets versions access latest --secret=" $ENV_SECRET_NAME " > .env
10-
113# other daily activites
124# ...
135
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ # service account
4+ gcloud secrets versions access latest --secret=" $SERVICE_ACCOUNT_SECRET_NAME " > service_account.json
5+ gcloud auth activate-service-account --key-file=service_account.json
6+ rm service_account.json
7+
8+ # .env
9+ gcloud secrets versions access latest --secret=" $ENV_SECRET_NAME " > .env
10+
11+ # run commands from file specified in GCP
12+ sh " /app/runners/$RUNNER_SCRIPT_NAME "
You can’t perform that action at this time.
0 commit comments