-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (98 loc) · 3.47 KB
/
sync_events.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
name: Sync events
on:
schedule:
- cron: '0 17 * * *'
workflow_dispatch:
env:
PLAYER_EN_USERNAME: ${{ secrets.PLAYER_EN_USERNAME }}
PLAYER_EN_PASSWORD: ${{ secrets.PLAYER_EN_PASSWORD }}
PLAYER_FR_USERNAME: ${{ secrets.PLAYER_FR_USERNAME }}
PLAYER_FR_PASSWORD: ${{ secrets.PLAYER_FR_PASSWORD }}
PLAYER_DE_USERNAME: ${{ secrets.PLAYER_DE_USERNAME }}
PLAYER_DE_PASSWORD: ${{ secrets.PLAYER_DE_PASSWORD }}
PLAYER_SP_USERNAME: ${{ secrets.PLAYER_SP_USERNAME }}
PLAYER_SP_PASSWORD: ${{ secrets.PLAYER_SP_PASSWORD }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
GOOGLE_API_KEY_2: ${{ secrets.GOOGLE_API_KEY_2 }}
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
GUILD_ID: ${{ secrets.GUILD_ID }}
GDOCS_TOKEN: ${{ secrets.GDOCS_TOKEN }}
BBSECRET: ${{ secrets.BBSECRET }}
jobs:
# Checkout all repos
Sync-New-Crew:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Website - Checkout
uses: actions/checkout@v4
with:
repository: stt-datacore/website
token: ${{ secrets.GH_ACCESS_TOKEN }}
path: website
- name: Scripts - Checkout
uses: actions/checkout@v4
with:
repository: stt-datacore/scripts
token: ${{ secrets.GH_ACCESS_TOKEN }}
path: scripts
- name: Zhatvash - Checkout
uses: actions/checkout@v4
with:
repository: stt-datacore/zhatvash
token: ${{ secrets.GH_ACCESS_TOKEN }}
path: scripts/zhatvash
- name: Scripts - npm install
run: npm ci
working-directory: scripts
- name: Scripts - eventparse.js
id: parseallcrew
run: node eventparse.js
working-directory: scripts
- name: Website - Check for changes
id: changes
run: |
if [[ `git status --porcelain` ]]; then
echo "::set-output name=changes::true"
else
echo "::set-output name=changes::false"
fi
working-directory: website
- name: Website - npm install
if: ${{ steps.changes.outputs.changes == 'true' }}
run: yarn install
working-directory: website
- name: Website - node scripts/precalculate.js
if: ${{ steps.changes.outputs.changes == 'true' }}
run: node scripts/precalculate.js
working-directory: website
- name: Website - Commit and push changes
if: ${{ steps.changes.outputs.changes == 'true' }}
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Autosync events"
git push
working-directory: website
- name: Scripts - Commit and push changes, if any
if: ${{ steps.changes.outputs.changes == 'true' }}
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Autosync events" || true
git push
working-directory: scripts
- name: Zhatvash - Commit and push changes, if any
if: ${{ steps.changes.outputs.changes == 'true' }}
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Autosync events" || true
git push
working-directory: scripts/zhatvash