-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (47 loc) · 1.61 KB
/
preview.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# https://github.com/rossjrw/pr-preview-action
name: Preview
on:
# NOT on push: branches: - 'main'
# ? delete:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
permissions:
contents: read
concurrency: preview-${{ github.ref }}
jobs:
preview:
name: Preview
runs-on: ubuntu-latest
# Sets permissions of the GITHUB_TOKEN to allow post comment with Preview URL
permissions:
issues: write
pull-requests: write
steps:
- name: Checkout PR head
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Build
if: ${{ github.event.action != 'closed' }} # Skipping these steps if the PR has been closed
run: ./build.sh
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
id: changes
with:
filters: |
workflows:
- '.github/workflows/**'
- name: Deploy preview
# https://github.com/www-learn-study/saraswati.learn.study/issues/50
if: steps.changes.outputs.workflows == 'false'
# TODO Re-check if https://github.com/actions/deploy-pages#inputs- support of "preview" is no longer "only in alpha currently and is not available to the public"
uses: rossjrw/pr-preview-action@v1.4.4
with:
source-dir: BUILT/site/
# https://github.com/www-learn-study/previews
deploy-repository: www-learn-study/previews
# custom-url: https://www-learn-study.github.io/previews
token: ${{ secrets.PREVIEW_TOKEN }}