feat: add CI
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Ashhhleyyy 2022-11-02 14:48:36 +00:00
parent 1b60f8aee3
commit 1f5bbae8a9
Signed by: ash
GPG key ID: 83B789081A0878FB
2 changed files with 46 additions and 0 deletions

34
.drone.yml Normal file
View file

@ -0,0 +1,34 @@
kind: pipeline
type: docker
name: Build
platform:
os: linux
arch: arm64
steps:
- name: Install dependencies
image: node-pnpm:16-alpine
commands:
- pnpm install --frozen-lockfile
- name: Build frontend
image: node-pnpm:16-alpine
commands:
- pnpm build
- name: Build server binary
image: rust:1.64.0-alpine
commands:
- cargo build --release
- name: Deploy site
image: alpine
commands:
- apk add curl ca-certificates zip
- cd dist && zip -r ../deploy.zip * && cd ..
- 'curl --fail --upload-file target/release/chs -H "Authorization: $GITEA_TOKEN" https://git.ashhhleyyy.dev/api/v1/packages/ash/generic/chs/$DRONE_COMMIT_SHA/chs'
environment:
GITEA_TOKEN:
from_secret: GITEA_TOKEN
trigger:
event: [push]
branch: [main]

12
README.md Normal file
View file

@ -0,0 +1,12 @@
# chs
A simple multiplayer chess game.
## Running yourself
My CI builds images for `aarch64` (not `amd64`/`x86_64` unfortunately), but you can build your own binary fairly easily.
- Install [Rust](https://rust-lang.org/), [pnpm](https://pnpm.io) and [cargo-make](https://crates.io/crates/cargo-make).
- Run `pnpm install` to download the frontend dependences
- Run `cargo make build-release` to build an executable with the frontend bundled
- The resulting binary will be in `target/release/chs`