-
Notifications
You must be signed in to change notification settings - Fork 352
139 lines (117 loc) · 3.59 KB
/
ci.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: CI
on:
pull_request:
push:
branches:
- 'staging'
- 'trying'
jobs:
generate-assets:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
generate-assets/target/
key: ${{ runner.os }}-generate-assets-${{ hashFiles('generate-assets/Cargo.toml') }}
- name: Get cache key
id: cache-key
run: echo "::set-output name=key::$(date +'%Y-%m-%d')"
- name: Get crates.io datadump from cache
uses: actions/cache@v2
with:
path: generate-assets/data
key: ${{ runner.os }}-${{ steps.cache-key.outputs.key }}
- name: "Build Bevy Assets"
run: >
cd generate-assets &&
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} &&
./generate_assets.sh
- uses: actions/upload-artifact@master
with:
name: generated-assets
path: content/assets
retention-days: 1
generate-errors:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
generate-errors/target/
key: ${{ runner.os }}-generate-errors-${{ hashFiles('generate-errors/Cargo.toml') }}
- name: "Build Bevy Error Codes"
run: >
cd generate-errors &&
./generate_errors.sh
- uses: actions/upload-artifact@master
with:
name: generated-errors
path: content/learn/errors
retention-days: 1
generate-wasm-examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: "Clone Bevy"
run: >
cd generate-wasm-examples &&
./clone_bevy.sh
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
generate-wasm-examples/bevy/target/
content/examples/**/*.wasm
key: ${{ runner.os }}-generate-wasm-examples-${{ hashFiles('generate-wasm-examples/bevy/Cargo.toml') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
- name: "Build Bevy Examples"
run: >
cargo install --force wasm-bindgen-cli &&
cd generate-wasm-examples &&
./generate_wasm_examples.sh
- uses: actions/upload-artifact@master
with:
name: generated-wasm-examples
path: content/examples
retention-days: 1
build-website:
runs-on: ubuntu-latest
needs: [generate-assets, generate-errors, generate-wasm-examples]
steps:
- uses: actions/checkout@master
- uses: actions/download-artifact@master
with:
name: generated-assets
path: content/assets
- uses: actions/download-artifact@master
with:
name: generated-errors
path: content/learn/errors
- uses: actions/download-artifact@master
with:
name: generated-wasm-examples
path: content/examples
- name: "Build website"
uses: shalzz/zola-deploy-action@master
env:
PAGES_BRANCH: gh-pages
BUILD_DIR: .
BUILD_ONLY: true
TOKEN: fake-secret