Merge pull request #248 from ajdumanhug/master #2
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 gh-pages site | |
on: | |
workflow_dispatch: # Manual dispatch | |
push: | |
branches: [ master ] | |
paths: ['CHECKLIST.md'] | |
jobs: | |
update-readme: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Configure git | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Liss.Bot" | |
- name: Copy CHECKLIST.md to gh-pages | |
run: | | |
# Fetch all branches | |
git fetch --all | |
# Switch to gh-pages branch | |
git checkout gh-pages | |
# Copy CHECKLIST from master branch | |
git checkout master -- CHECKLIST.md | |
# Move and rename CHECKLIST.md to the root | |
mv CHECKLIST.md README.md | |
# Check if there are changes, if so commit and push | |
if [ -n "$(git status --porcelain)" ]; then | |
git add README.md | |
git commit -m "Update README.md from master branch" | |
git push origin gh-pages | |
else | |
echo "No changes in README.md" | |
fi |