-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (76 loc) · 2.73 KB
/
Copy pathdeploy-server.yaml
File metadata and controls
86 lines (76 loc) · 2.73 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
# This file is part of Metaplay SDK which is released under the Metaplay SDK License.
# Reusable Github Actions workflow to deploy a game server
name: deploy-server
on:
workflow_call:
secrets:
METAPLAY_CREDENTIALS:
description: "Metaplay cloud machine account credentials"
required: true
inputs:
organization:
description: "Name of the organization (must match the organization in the portal)"
required: true
type: string
project:
description: "Name of the project (must match the project in the portal)"
required: true
type: string
environment:
description: "Name of the environment to deploy to (must match the environment in portal)"
required: true
type: string
image-tag:
description: "Image tag to use for server docker image"
required: false
type: string
default: ${{ github.sha }}
deployment-values-file:
description: "Relative path from repo root for the Helm values file to use for deployment"
required: true
type: string
helm-repo:
description: "Helm repository for deployment chart"
required: false
type: string
default: "https://charts.metaplay.dev/"
helm-chart-version:
description: "Helm chart version to use"
required: true
type: string
helm-version:
description: "Helm version"
required: false
type: string
default: "v3.14.3"
jobs:
# Deploy the server using Helm
deploy-server:
runs-on: ubuntu-latest
steps:
# Checkout the repository.
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 1
show-progress: false # suppress the noisy progress status output
# Install required tools
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: 'v3.18.4'
# Install metaplay-auth
- name: Set up metaplay-auth
run: npm i -g @metaplay/metaplay-auth
# Login to Metaplay cloud with the machine account credentials
- name: Login to Metaplay cloud
env:
METAPLAY_CREDENTIALS: ${{ secrets.METAPLAY_CREDENTIALS }}
run: metaplay-auth machine-login
# Get Kubernetes credentials & deploy the game server using Helm
- name: Deploy game server
run: |
metaplay-auth deploy-server ${{ inputs.organization }}-${{ inputs.project }}-${{ inputs.environment }} ${{ inputs.image-tag }} --helm-chart-repo=${{ inputs.helm-repo }} --helm-chart-version=${{ inputs.helm-chart-version }} --values=${{ inputs.deployment-values-file }}