Skip to content

Commit

Permalink
add github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
abulte committed Jun 12, 2024
1 parent 9622016 commit d44d37c
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 26 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/generate-sitemap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Generate and publish sitemap

on:
schedule:
- cron: '42 0 * * *'
push:
branches:
- main

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

jobs:
generate-sitemap:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5

- name: Generate sitemap
run: python generate.py

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./dist

deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: generate-sitemap
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/*.xml
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

22 changes: 0 additions & 22 deletions app.py

This file was deleted.

Empty file added dist/.gitkeep
Empty file.
3 changes: 0 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
requests
flask
gunicorn
flask-caching

0 comments on commit d44d37c

Please sign in to comment.