-
Notifications
You must be signed in to change notification settings - Fork 21
96 lines (79 loc) · 3.46 KB
/
Copy pathci.yml
File metadata and controls
96 lines (79 loc) · 3.46 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
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
name: Deploy
on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: "0 18 1 * *"
repository_dispatch:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ⏬ Install Rust toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source ~/.cargo/env
rustup target add wasm32-unknown-unknown
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: ⏬ Install zola
run: |
set -e
curl -sSL https://github.com/getzola/zola/releases/download/v0.22.1/zola-v0.22.1-x86_64-unknown-linux-gnu.tar.gz | tar xz
sudo install "$(pwd)/zola" /usr/local/bin
zola --version
- name: ⏬ Install gh-stats
run: |
set -e
mkdir bin
curl -sSL https://github.com/mre/gh-stats/releases/download/v0.1.0/gh-stats-v0.1.0-x86_64-unknown-linux-gnu.tar.gz | tar xz --directory=bin
sudo install "$(pwd)/bin/gh-stats" /usr/local/bin
- name: ⏬ Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: ⏬ Install tinysearch
run: |
set -e
curl -sSL https://github.com/tinysearch/tinysearch/releases/download/v0.10.0/tinysearch-v0.10.0-x86_64-unknown-linux-gnu.tar.gz | tar xz
sudo install "$(pwd)/tinysearch" /usr/local/bin
- name: ⏬ Install cavif
run: |
set -e
curl -sSL https://github.com/kornelski/cavif-rs/releases/download/v1.3.3/cavif-1.3.3.zip --output cavif.zip
unzip cavif.zip -d cavif
sudo install "$(pwd)/cavif/linux-generic/cavif" /usr/local/bin
- name: ⏬ Install binaryen
run: |
set -e
curl -L https://github.com/WebAssembly/binaryen/releases/download/version_104/binaryen-version_104-x86_64-linux.tar.gz | tar xzf -
sudo install "$(pwd)/binaryen-version_104/bin/wasm-opt" /usr/local/bin
- name: ⏬ Install terser
run: sudo npm install -g terser
- name: ⏬ Install ImageMagick
run: sudo apt-get update && sudo apt-get install -y imagemagick
# Ideally we'd install ImageMagick 7 here because it provides the new `magick` binary that we use later.
# However it's quite tedious to do right now, see
# https://github.com/walterbm/rusty-resizer/blob/33295758168171d3ad022e9e4938525f2d264017/.github/workflows/ci.yml#L13-L27
# Instead, we just alias the old binary name to the new one because we don't use any of the new functionality.
- name: 🔗 Alias ImageMagick
run: sudo ln -s /usr/bin/convert /usr/bin/magick
- name: 🔍 Tool versions
run: make versions
- name: 🏞 Images
run: make images
- name: 📖 Build
run: make build
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
- name: 🚀 Deploy to Cloudflare Pages
if: github.ref == 'refs/heads/master'
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: 1c71f27d6fa097a1576b4ffab9186fa8
# Project name and build output directory are read from wrangler.toml.
# `--commit-dirty=true` silences the warning about `make stars`
# writing to content/static/about/stars.md during the build.
command: pages deploy --branch=master --commit-dirty=true