-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 1.12 KB
/
cronjob.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Write GitHub Data To Google Cloud Storage
on:
schedule:
- cron: "15 0 * * *"
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
github-to-gcs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Google Cloud Auth
uses: google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f # v2.1.7
with:
project_id: "groovy-momentum-434802-g9"
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
- name: Run CronJob
run: go run cmd/cronjob/main.go
notify-on-failure:
needs: github-to-gcs
runs-on: ubuntu-latest
if: ${{ !success() }}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Send Notification Email
run: go run cmd/sendemail/main.go
env:
GMAIL_APP_PASSWORD: ${{ secrets.GMAIL_APP_PASSWORD }}
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}