auto-update #518
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |