-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (47 loc) · 1.5 KB
/
consumer.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
on:
push:
branches:
- main
paths:
- ".github/workflows/consumer.yml"
- ".github/scripts/auth.sh"
- ".github/scripts/deploy.sh"
- "async-server-provisioner/*"
- "async-server-provisioner/*/*"
- "async-server-provisioner/*/*/*"
- "async-server-provisioner/*/*/*/*"
- "async-server-provisioner/*/*/*/*/*"
- "infrastructure/terraform/02-game-server/**/*"
name: Cloud Game Consumer
jobs:
build:
name: Build Consumer
runs-on: ubuntu-latest
env:
IMAGE: cloudgame/async-server-provisioner
steps:
- uses: actions/checkout@master
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Docker Container
run: |
docker build -t $IMAGE:$GITHUB_RUN_ID -f async-server-provisioner/Dockerfile --build-arg DD_GIT_REPOSITORY_URL=$(git config --get remote.origin.url) --build-arg DD_GIT_COMMIT_SHA=${{ github.sha }} .
- name: Push Container
run: |
docker tag $IMAGE:$GITHUB_RUN_ID $IMAGE:latest
docker push $IMAGE:$GITHUB_RUN_ID
docker push $IMAGE:latest
deploy:
name: Deploy
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@master
- name: Deploy to Server
env:
DEPLOY_SSH_PRIV_KEY: ${{ secrets.DEPLOY_SSH_PRIV_KEY }}
run: ./.github/scripts/deploy.sh