-
Notifications
You must be signed in to change notification settings - Fork 2
46 lines (39 loc) · 1.38 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
# https://github.com/rossjrw/pr-preview-action
name: Preview
on:
# NOT on push: branches: - 'main'
# ? delete:
pull_request_target:
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
if: ${{ startsWith(github.event_name, 'pull_request') && github.event.action != 'closed' }}
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Build
if: ${{ github.event.action != 'closed' }} # Skipping these steps if the PR has been closed
# run: ./build.sh
run: echo "Hi! Buidling..."
- name: Deploy preview
# 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
with:
source-dir: ./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 }}