-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (52 loc) · 1.69 KB
/
ci.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
52
name: CI
on: [push, pull_request]
jobs:
docker-build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: docker build . -t ghcr.io/micromaomao/bellclone-ws:latest
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: docker push ghcr.io/micromaomao/bellclone-ws:latest
build-client:
runs-on: ubuntu-latest
container:
image: rust:latest
steps:
- name: Install wasm-pack
run: curl 'https://rustwasm.github.io/wasm-pack/installer/init.sh' -sSf | sh
- name: Install flatc
run: >
apt-get update -y && apt-get install -y curl unzip &&
mkdir /tmp/flatc &&
cd /tmp/flatc &&
curl -sL 'https://github.com/google/flatbuffers/releases/download/v2.0.0/Linux.flatc.binary.clang++-9.zip' -o flatc.zip &&
unzip flatc.zip &&
cp flatc /usr/bin &&
chmod a+rx /usr/bin/flatc
- uses: actions/checkout@v2
- run: ./package-client.sh
- uses: actions/upload-artifact@v2
with:
name: package
path: client.tar.gz
upload:
runs-on: ubuntu-latest
needs: build-client
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: package
- run: tar --one-top-level=dist -zxvf client.tar.gz
- run: echo bellclone.maowtm.org > dist/CNAME
- uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: dist