-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (49 loc) · 1.81 KB
/
build-game-server.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
name: "Build CosmicKube game server"
on:
push:
branches:
- main
jobs:
build-server:
name: "Build Game Server"
runs-on: ubuntu-20.04
permissions:
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
override: true
- name: Build
run: |
cd backend
cargo build --all --release && strip target/release/cosmic_kube && mv target/release/cosmic_kube target/release/cosmic_kube_amd64
- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: server
path: backend/target/release/cosmic_kube_amd64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# this will push the docker images to the github container registry
# you will need to give actions permission to push there first
- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
context: .
file: backend/server.Dockerfile
push: true
tags: |
ghcr.io/pilksoc/cosmickube:dev-latest
ghcr.io/pilksoc/cosmickube:dev-${{ github.run_number }}