-
Notifications
You must be signed in to change notification settings - Fork 11
40 lines (36 loc) · 1.36 KB
/
update.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: FortniteStats Updater
on:
schedule:
- cron: '*/5 * * * *'
workflow_run:
workflows: ["metrics"]
branches: [master]
types:
- completed
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: 🎏 Fetch Repository
uses: actions/checkout@master
with:
fetch-depth: 1
- name: 🎏 Fetch Fortnite Stats
run: |
cd ${GITHUB_WORKSPACE}/
npm i twitter
node src/update.js
env:
API_SECRET: ${{ secrets.FN_API_KEY }}
FORTNITE_USERNAME: ${{ secrets.FORTNITE_USERNAME }}
TWITTER_API_KEY: ${{ secrets.TWITTER_API_KEY }}
TWITTER_SECRET: ${{ secrets.TWITTER_SECRET }}
TWITTER_ACCESS_KEY: ${{ secrets.TWITTER_ACCESS_KEY }}
TWITTER_TOKEN_SECRET: ${{ secrets.TWITTER_TOKEN_SECRET }}
- name: 🚀 Deploy Update
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add .
git commit -am "[Auto] Updated ${{ secrets.FORTNITE_USERNAME }}'s Stats"
git push --all -f https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git