Daily rebuild #1289
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
# This is a basic workflow to help you get started with Actions | |
name: Daily rebuild | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
schedule: | |
- cron: "0 7,13 * * *" | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@main | |
# with: | |
# repository: adamdjbrett/relcfp | |
# token: ${{ secrets.RELCFPCHRONJOB }} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install xmltodict requests | |
# Runs a single command using the runners shell | |
- name: Get RSS | |
id: check | |
run: python get_rss.py | |
- name: Add & Commit | |
if: steps.check.outputs.content_changed == 'true' | |
uses: EndBug/add-and-commit@main | |
with: | |
add: feed.xml | |
- name: Use Github App | |
uses: actions/create-github-app-token@v1 | |
if: steps.check.outputs.content_changed == 'true' | |
id: generate-app-token | |
with: | |
app-id: ${{ vars.APP_ID }} | |
private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
- name: Print result | |
if: steps.check.outputs.content_changed == 'true' | |
run: cat _data/feed.json | |
- name: Configure Git | |
if: steps.check.outputs.content_changed == 'true' | |
run: | | |
git config --global user.name 'adamdjbrett' | |
git config --global user.email '[email protected]' | |
- name: Commit and push changes | |
if: steps.check.outputs.content_changed == 'true' | |
run: | | |
git add _data/feed.json | |
git commit -m 'Save output to file' | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }} | |
- name: Deploy to Netlify | |
uses: lwojcik/github-action-deploy-static-site@v1 | |
if: steps.check.outputs.content_changed == 'true' | |
with: | |
platform: netlify | |
netlify_deploy_hook_url: ${{ secrets.NETLIFY_DEPLOY_HOOK_URL }} | |
always_deploy: true |