-
Notifications
You must be signed in to change notification settings - Fork 7
77 lines (71 loc) · 2.36 KB
/
deploy.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Deploy Colab + Next.js site to GitPages
on:
push:
branches: ["main"]
#A: on pushes targeting the default branch
workflow_dispatch:
#A: Allows you to run this workflow manually from the Actions tab
permissions:
contents: read
pages: write
id-token: write
#A: permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
concurrency:
group: "pages"
cancel-in-progress: false
#A: only one concurrent deployment, skip runs queued between the run in-progress and latest queued.
#A: do NOT cancel in-progress runs
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python #A: for Colab, nbconvert
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Setup Java #A: for plantuml
uses: actions/setup-java@v3
with:
distribution: 'oracle'
java-version: '17'
- name: Setup Graphviz #A: for plantuml
uses: ts-graphviz/setup-graphviz@v1
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Run prepare script
run: _build/prepare.sh
- name: Restore cache
#XXX: Entender y usar
#SEE: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows
uses: actions/cache@v3
with:
path: |
.site/next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- name: Build Site
run: ./site/src/bin/build.sh
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./site/out
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2