2022-04-26 18:32:52 +00:00
|
|
|
name: 🔂 Surge PR Preview
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request_target:
|
|
|
|
types: [opened, synchronize, reopened, closed]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
preview:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
issues: write
|
|
|
|
pull-requests: write
|
|
|
|
contents: write
|
|
|
|
environment: preview
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: '0'
|
|
|
|
ref: ${{github.event.pull_request.head.ref}}
|
|
|
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
2022-04-27 02:36:58 +00:00
|
|
|
ssh-key: ${{ secrets.ACTIONS_SSH_KEY }}
|
|
|
|
submodules: 'true'
|
2022-04-26 18:32:52 +00:00
|
|
|
|
|
|
|
- name: Set up Python runtime
|
|
|
|
uses: actions/setup-python@v3
|
|
|
|
with:
|
2022-04-27 02:36:58 +00:00
|
|
|
python-version: '3.7'
|
2022-04-26 18:32:52 +00:00
|
|
|
|
|
|
|
- name: Deploy to surge.sh
|
|
|
|
uses: afc163/surge-preview@v1
|
|
|
|
with:
|
|
|
|
surge_token: ${{ secrets.SURGE_TOKEN }}
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
dist: site
|
|
|
|
teardown: 'true'
|
2022-04-27 02:36:58 +00:00
|
|
|
failOnError: 'true'
|
2022-04-26 18:32:52 +00:00
|
|
|
build: |
|
2022-04-27 02:36:58 +00:00
|
|
|
pip install pipenv
|
|
|
|
pipenv install
|
|
|
|
pipenv run mkdocs build
|