Debug: Restore website deployment to GitHub Pages #1
Workflow file for this run
This file contains hidden or 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 Preview for Pull Requests | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.1 | |
bundler-cache: true | |
- name: Install dependencies | |
run: | | |
bundle install | |
- name: Build Jekyll site | |
run: | | |
bundle exec jekyll build --destination _site | |
- name: Copy site to PR-specific folder | |
run: | | |
mkdir pr_preview | |
mv _site pr_preview/${{ github.event.pull_request.number }} | |
- name: Deploy to GitHub Pages for preview | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
personal_token: ${{ secrets.PR_PREVIEW_TOKEN }} | |
publish_branch: gh-pages | |
publish_dir: ./pr_preview | |
external_repository: open-life-science/ols-site-preview | |
cname: '' | |
- name: Comment with preview URL | |
env: | |
GITHUB_TOKEN: ${{ secrets.PR_PREVIEW_TOKEN }} | |
run: | | |
PREVIEW_URL="https://we-are-ols.org/ols-site-preview/${{ github.event.pull_request.number }}" | |
COMMENT_BODY="🎉 A preview of this PR is available at: [${PREVIEW_URL}](${PREVIEW_URL})" | |
gh pr comment ${{ github.event.pull_request.number }} --body "$COMMENT_BODY" |