Deploy to Github Pages and Update #15
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 to Github Pages and Update | |
on: | |
push: | |
branches: | |
- master | |
- main | |
schedule: | |
- cron: "0 0 * * *" | |
permissions: | |
contents: write | |
jobs: | |
deploy_and_update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Fetch PhishingBook.md from external repository | |
run: | | |
curl -o docs/PhishingBook.md https://raw.githubusercontent.com/tib36/PhishingBook/main/README.md | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: pip install mkdocs-material | |
- name: Deploy MkDocs | |
run: mkdocs gh-deploy --force | |
- name: Check for changes | |
id: check_changes | |
run: | | |
git add docs/PhishingBook.md | |
if [ -n "$(git status --porcelain)" ]; then | |
echo "CHANGES=true" >> $GITHUB_ENV | |
fi | |
- name: Commit and push changes | |
if: env.changes == 'true' | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Automatically update |