Skip to content

Commit

Permalink
try pushing index to gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmeaton committed Sep 28, 2020
1 parent fea299e commit 2b7d449
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions .github/workflows/site.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------#
name: Site
name: Update Site
#------------------------------------------------------------------------------#
# Workflow conditions
on:
Expand All @@ -25,17 +25,22 @@ jobs:
uses: actions/checkout@v2.3.1 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false

- name: create site dir
- name: update site content
run: |
mkdir -p build/
echo "---\nlayout: home\n---" > build/index.md
cat README.md >> build/index.md
- name: deploy site to gh-pages
uses: JamesIves/github-pages-deploy-action@3.6.2
echo "---\nlayout: home\n---" > index.md
cat README.md >> index.md
#------------------------------------------------------------------------#
# Commit and push the new README
- name: add and commit content
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -f index.md
git commit -m 'update readme index' || echo "No changes to commit"
# Keep push separate for authentication
- name: push content
uses: ad-m/github-push-action@master
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: build # The folder the action should deploy.
CLEAN: false # Automatically remove deleted files from the deploy branch
github_token: ${{ secrets.ACTIONS_DEPLOY_KEY }}
branch: gh-pages

0 comments on commit 2b7d449

Please sign in to comment.