-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (42 loc) · 1.21 KB
/
build.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
name: Build and Preview
on:
pull_request:
types:
- opened
- synchronize
- reopened
- closed
workflow_dispatch:
jobs:
build:
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
runs-on: ubuntu-latest
steps:
- name: Set Timezone
uses: szenius/[email protected]
with:
timezoneLinux: "America/Los_Angeles"
- name: Checkout 🛎️
uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@v4
- uses: DeterminateSystems/magic-nix-cache-action@v2
- run: npm i
- name: Change config for PR preview build
run: |
sed -i '11 i "base": "/pr-preview/pr-${{ github.event.number }}",' astro.config.mjs
- name: Build
if: github.event.action != 'closed'
run: |
nix build
- name: Copy build result
run: |
cp -rv $(readlink -f result) out
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./out/
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: website
path: out/**