-
-
Notifications
You must be signed in to change notification settings - Fork 6
51 lines (43 loc) · 1.43 KB
/
build.yml
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
on:
workflow_call:
inputs:
ref:
description: "The git ref to build"
required: true
type: string
jobs:
build:
name: Build with Next.js
runs-on: ubuntu-latest
outputs:
artifact-name: ${{ steps.name-artifact.outputs.artifact-name }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
- uses: actions/setup-node@v3
with:
node-version: "19"
- name: Cache Next.js build
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**.[jt]sx?') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-
- run: pipx install sqlite-diffable
- run: yarn
- run: yarn export
- id: name-artifact
name: Set artifact name
run: echo "::set-output name=artifact-name::website-${{ github.sha }}"
- name: Create tar archive
run: tar czf out.tar.gz -C ${{ github.workspace }}/out .
- name: Upload tar archive
uses: actions/upload-artifact@v3
with:
name: ${{ steps.name-artifact.outputs.artifact-name }}
path: out.tar.gz