Update One Pace episodes #369
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: Update One Pace episodes | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: 0 * * * * | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
cache: npm | |
node-version: lts/* | |
- name: Install dependencies | |
run: npm ci | |
- name: Cache torrent files | |
uses: actions/cache@v4 | |
with: | |
path: cache | |
key: torrents | |
- name: Scrape One Pace website | |
id: scrape | |
run: | | |
echo "message<<EOF" >> "$GITHUB_OUTPUT" | |
npm run --silent scrape >> "$GITHUB_OUTPUT" | |
echo "EOF" >> "$GITHUB_OUTPUT" | |
- name: Commit changes | |
id: commit | |
uses: EndBug/add-and-commit@v9 | |
with: | |
message: Update One Pace episodes | |
default_author: github_actions | |
- name: Send message to Matrix | |
uses: s3krit/[email protected] | |
if: steps.commit.outputs.pushed && steps.scrape.outputs.message != '' | |
with: | |
server: ${{ vars.MATRIX_SERVER }} | |
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }} | |
room_id: ${{ vars.MATRIX_ROOM_ID }} | |
message: ${{ steps.scrape.outputs.message }} |