You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/Deploy.yml
+31-1Lines changed: 31 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4,19 +4,49 @@ on:
4
4
push:
5
5
branches:
6
6
- main
7
+
pull_request:
8
+
9
+
concurrency:
10
+
# Skip intermediate builds: always.
11
+
# Cancel intermediate builds: always.
12
+
group: ${{ github.workflow }}-${{ github.ref }}
13
+
cancel-in-progress: true
7
14
8
15
jobs:
16
+
preview:
17
+
runs-on: ubuntu-latest
18
+
outputs:
19
+
preview: ${{ steps.set-preview.outputs.preview }}
20
+
steps:
21
+
- name: Set Preview
22
+
id: set-preview
23
+
run: |
24
+
if [[ ${{ github.event_name }} == "pull_request" ]]; then
25
+
PREVIEW="previews/PR${PRNUM}"
26
+
else
27
+
PREVIEW=""
28
+
fi
29
+
echo "preview=${PREVIEW}"
30
+
echo "preview=${PREVIEW}" >> "${GITHUB_OUTPUT}"
31
+
env:
32
+
PRNUM: ${{ github.event.number }}
33
+
9
34
deploy:
35
+
needs: preview
10
36
runs-on: ubuntu-latest
11
37
permissions: write-all
12
38
steps:
13
-
- uses: actions/checkout@v2
39
+
- uses: actions/checkout@v3
40
+
- uses: julia-actions/cache@v1
14
41
- uses: tlienart/xranklin-build-action@v3.2
42
+
if: github.event_name != 'pull_request' || github.repository == github.event.pull_request.head.repo.full_name # if this build is NOT a PR build, OR if this build is a PR build and the PR is NOT from a fork
15
43
with:
16
44
# NOTE: this is the Xranklin branch the site is built with
17
45
BRANCH: "dev"
18
46
# NOTE: this is the base URL prefix (landing page at /$BASE_URL_PREFIX/)
0 commit comments