Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
rominronin authored Jan 31, 2024
1 parent 4589a37 commit 31dbea4
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,34 @@ jobs:
with:
name: site
path: _site
# Now we can deploy the site to GitHub Pages!
deploy:
runs-on: ubuntu-latest
needs: build # Run the build job first, otherwise we won't have anything to deploy

steps:
- uses: actions/checkout@v3
with:
ref: 'gh-pages' # Checkout the gh-pages branch

# (optional) Remove any old files from the gh-pages branch
- name: Empty site directory
run: rm -rf *

# Download the compiled site into the current directory
- name: Download site artifact
uses: actions/download-artifact@v3
with:
name: site
path: '.'

# Create a .nojekyll file to prevent GitHub from attempting to compile a Jekyll site
- name: Create .nojekyll file
run: touch .nojekyll

# Commit the changes to the gh-pages branch
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
add: '.'
message: 'Upload compiled site ${{ github.sha }}'

0 comments on commit 31dbea4

Please sign in to comment.