-
Notifications
You must be signed in to change notification settings - Fork 38
121 lines (111 loc) · 3.42 KB
/
astro.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Deploy to GitHub Pages
on:
# Trigger the workflow every time you push to the `main` branch
# Using a different branch name? Replace `main` with your branch’s name
push:
branches: [master]
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:
# Allow this job to clone the repo and create a page deployment
permissions:
actions: read
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
fetch-rss:
runs-on: ubuntu-latest
steps:
- run: wget -O rss.xml https://utelecon.adm.u-tokyo.ac.jp/notice/rss.xml
- run: wget -O rss-en.xml https://utelecon.adm.u-tokyo.ac.jp/en/notice/rss.xml
- uses: actions/upload-artifact@v4
with:
path: |
rss.xml
rss-en.xml
name: rss-old
build:
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Setup node_modules Cache
uses: actions/cache@v4
with:
path: |
~/.npm
node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install
run: |
npm install
- name: Build
run: |
npm run build
- name: Check unused assets
run: |
npm run unused-asset
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist
- name: Collect RSS Artifact
run: |
cp dist/notice/rss.xml rss.xml
cp dist/en/notice/rss.xml rss-en.xml
- name: Upload RSS Artifact
uses: actions/upload-artifact@v4
with:
path: |
rss.xml
rss-en.xml
name: rss-new
deploy:
needs: [fetch-rss, build]
if: ${{ needs.build.result == 'success' }}
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
twitter:
needs: [fetch-rss, build]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: rss-old
path: rss-old
- uses: actions/download-artifact@v4
with:
name: rss-new
path: rss-new
- name: Twitter
uses: utelecon/rssdiff-to-twitter@main
with:
OLD_RSS: "rss-old/rss.xml"
NEW_RSS: "rss-new/rss.xml"
TWITTER_APIKEY: ${{ secrets.TWITTER_APIKEY }}
TWITTER_APIKEY_SECRET: ${{ secrets.TWITTER_APIKEY_SECRET }}
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
- name: Twitter (English)
uses: utelecon/rssdiff-to-twitter@main
with:
OLD_RSS: "rss-old/rss-en.xml"
NEW_RSS: "rss-new/rss-en.xml"
TWITTER_APIKEY: ${{ secrets.TWITTER_EN_APIKEY }}
TWITTER_APIKEY_SECRET: ${{ secrets.TWITTER_EN_APIKEY_SECRET }}
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_EN_ACCESS_TOKEN }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_EN_ACCESS_TOKEN_SECRET }}