Try this out #5
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
--- | |
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | |
name: "Docs" | |
on: | |
push: | |
branches: ["main"] | |
paths: | |
- README.md | |
permissions: | |
pages: write | |
contents: write | |
jobs: | |
copy: | |
name: Copy docs | |
runs-on: ubuntu-latest | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: git pull | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: git pull | |
- name: Copy README.md to index.md | |
run: cp README.md index.md | |
- name: Deploy to gh-pages | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git checkout -b gh-pages || git checkout gh-pages | |
git status | |
git add index.md | |
git commit -m "Update index.md from README.md" || echo "No changes to commit" | |
git push origin gh-pages |