2022-04-26 20:32:52 +02:00
|
|
|
name: 🔂 Surge PR Preview
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request_target:
|
2022-04-27 06:13:24 +02:00
|
|
|
types: [opened, synchronize, reopened]
|
2022-08-07 04:23:48 +02:00
|
|
|
|
2022-05-02 17:42:09 +02:00
|
|
|
# Ensures that only one mirror task will run at a time.
|
|
|
|
concurrency:
|
|
|
|
group: surge-sh
|
2022-04-26 20:32:52 +02:00
|
|
|
|
|
|
|
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 04:36:58 +02:00
|
|
|
ssh-key: ${{ secrets.ACTIONS_SSH_KEY }}
|
|
|
|
submodules: 'true'
|
2022-04-26 20:32:52 +02:00
|
|
|
|
|
|
|
- name: Set up Python runtime
|
2022-06-09 06:13:39 +02:00
|
|
|
uses: actions/setup-python@v4
|
2022-04-26 20:32:52 +02:00
|
|
|
with:
|
2022-08-25 03:18:26 +02:00
|
|
|
python-version: '3.10'
|
2022-04-26 20:32:52 +02:00
|
|
|
|
|
|
|
- name: Deploy to surge.sh
|
|
|
|
uses: afc163/surge-preview@v1
|
2022-08-07 04:23:48 +02:00
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2022-08-25 03:18:26 +02:00
|
|
|
CARDS: true
|
2022-04-26 20:32:52 +02:00
|
|
|
with:
|
|
|
|
surge_token: ${{ secrets.SURGE_TOKEN }}
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
dist: site
|
2022-04-27 04:36:58 +02:00
|
|
|
failOnError: 'true'
|
2022-04-26 20:32:52 +02:00
|
|
|
build: |
|
2022-09-02 04:32:26 +02:00
|
|
|
pip install -Iv pipenv==2022.8.24
|
2022-04-27 04:36:58 +02:00
|
|
|
pipenv install
|
2022-08-11 06:22:48 +02:00
|
|
|
pipenv run mkdocs build --config-file mkdocs.production.yml
|