Skip to content

Debug: Restore website deployment to GitHub Pages #1

Debug: Restore website deployment to GitHub Pages

Debug: Restore website deployment to GitHub Pages #1

Workflow file for this run

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"