-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (38 loc) · 1.16 KB
/
main.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
41
42
43
44
45
46
47
48
49
name: main
on:
# run this workflow manually from the Actions tab
workflow_dispatch:
schedule:
- cron: "0 5 * * *"
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
# for gcp and git-auto-commit-action
contents: write
id-token: write
steps:
- name: Clone repository
uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- name: Setup GCP
id: auth
uses: google-github-actions/auth@v2
with:
credentials_json: "${{ secrets.GCP_CREDENTIALS }}"
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Download sqlite
run: gcloud storage cp gs://hnhd/hackernews.sqlite ./data
- run: bun install
- run: bun run src/update.ts
- run: bun run src/output.ts
- name: Upload sqlite
run: gcloud storage cp ./data/hackernews.sqlite gs://hnhd/hackernews.sqlite
- name: Remove sqlite
run: rm ./data/hackernews.sqlite
- name: Commit if changed
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: updated with the latest headlines