-
Notifications
You must be signed in to change notification settings - Fork 7
69 lines (65 loc) · 2.22 KB
/
Deploy.yml
File metadata and controls
69 lines (65 loc) · 2.22 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Deploy
on:
push:
branches:
- main
pull_request:
concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: always.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
options:
name: "Set options"
runs-on: ubuntu-latest
outputs:
deploy: ${{ steps.set-options.outputs.deploy }}
preview: ${{ steps.set-options.outputs.preview }}
steps:
- name: Set options
id: set-options
run: |
# By default always deploy
DEPLOY="true"
# Create previews only for pull requests
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
PREVIEW="previews/PR${PRNUM}"
# For pull requests, actually deploy only if the PR was opened on the same
# repository.
if [[ "${{ github.repository }}" != "${{ github.event.pull_request.head.repo.full_name }}" ]]; then
DEPLOY="false"
fi
else
PREVIEW=""
fi
echo "deploy=${DEPLOY}"
echo "deploy=${DEPLOY}" >> "${GITHUB_OUTPUT}"
echo "preview=${PREVIEW}"
echo "preview=${PREVIEW}" >> "${GITHUB_OUTPUT}"
env:
PRNUM: ${{ github.event.number }}
deploy:
name: "Build and Deploy"
needs: options
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v2
with:
# Same version as the one used to resolve the manifest
version: '1.12.5'
- uses: julia-actions/cache@v3
- name: Instantiate environment
run: |
julia --color=yes --project -e 'using Pkg; Pkg.instantiate()'
- uses: tlienart/xranklin-build-action@5ccfbb9932a3f9f7536fc6c41da0910b97ee853c
with:
# NOTE: this is the base URL prefix (landing page at /$BASE_URL_PREFIX/)
BASE_URL_PREFIX: ""
# Whether to deploy the website or not. Can do only for PRs opened
# from the same repository.
DEPLOY: ${{ needs.options.outputs.deploy }}
# Directory where to deploy the website.
PREVIEW: ${{ needs.options.outputs.preview }}