Deploy Static Site #86
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: Deploy Static Site | |
on: | |
schedule: | |
- cron: '0 4 * * *' | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
# Single deploy job since we're just deploying | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: windows-latest | |
steps: | |
- name: Setup Msys2 | |
uses: msys2/setup-msys2@v2 | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
path: blacklist | |
- name: Get 7z File | |
run: | | |
wget -O 7zr.exe https://github.com/853Lab/VRChat-World-BlackList/releases/download/0.0.1/7zr.exe | |
wget -O VRCBlackListTool.7z https://github.com/853Lab/VRChat-World-BlackList/releases/download/0.0.1/TheTool.7z | |
shell: msys2 {0} | |
- name: SHA of result file | |
id: initial | |
run: echo "hash=$(shasum -a 512 blacklist/blacklist.txt | awk '{ print $1 }')" >> $GITHUB_OUTPUT | |
shell: msys2 {0} | |
- name: Unpack And Run File | |
run: | | |
7zr.exe x VRCBlackListTool.7z -oVRCBlackListTool | |
mkdir pages | |
.\VRCBlackListTool\VRChatBlackList.exe --user=${{ secrets.VRC_USER }} --password=${{ secrets.VRC_PASS }} --secret=${{ secrets.VRC_SECRET }} --key=${{ secrets.KEY }} --iv=${{ secrets.IV }} --min=${{ secrets.MIN }} --input=blacklist\blacklist.txt --image=VRCBlackListTool\blacklistsource.png --output=pages\blacklist.png | |
shell: cmd | |
- name: SHA of result file | |
id: final | |
run: echo "hash=$(shasum -a 512 blacklist/blacklist.txt | awk '{ print $1 }')" >> $GITHUB_OUTPUT | |
shell: msys2 {0} | |
- name: Compare hashes and commit if different | |
if: steps.initial.outputs.hash != steps.final.outputs.hash | |
run: | | |
cd blacklist | |
git config --local user.email "Sonic853@qq.com" && git config --local user.name "853 Action" | |
git add blacklist.txt | |
git commit -m "Update blacklist" | |
git push | |
shell: cmd | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
# Upload entire repository | |
path: './pages' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |