forked from yxnan/block-l4d2-rpg-servers
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (51 loc) · 1.42 KB
/
auto-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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: auto-update
on:
workflow_dispatch:
pull_request:
types: [synchronize, opened, reopened]
push:
branches: [master]
schedule:
- cron: '0 0 * * *'
permissions:
contents: write
jobs:
generate_rpg_list:
name: Generate RPG List
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sudo apt install -y curl jq
- shell: bash
env:
steam_api_key: ${{ secrets.steam_api_key }}
run: ./build-rpglist.sh "$steam_api_key"
- name: Set date env
run: |
echo "TODAY=$(date '+%Y/%m/%d')" >> $GITHUB_ENV
echo "FILENAME=rpglist-$(date '+%Y-%m-%d').json" >> $GITHUB_ENV
- name: commit
run: |
git config --global user.name "Github Action"
git config --global user.email "[email protected]"
git add rpglist-latest.json
git commit -m "auto update" -a
git push
env:
GITHUB_TOKEN: ${{ secrets.UPDATE_TOKEN }}
- name: Update latest Release
uses: softprops/action-gh-release@v1
with:
files: rpglist-latest.json
tag_name: latest
name: ${{ env.TODAY }}
env:
GITHUB_TOKEN: ${{ secrets.UPDATE_TOKEN }}
- name: Update Everyday Release
uses: softprops/action-gh-release@v1
with:
files: ${{ env.FILENAME }}
tag_name: ${{ env.TODAY }}
name: ${{ env.TODAY }}
env:
GITHUB_TOKEN: ${{ secrets.UPDATE_TOKEN }}