-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (50 loc) · 1.6 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
51
52
53
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: 220002198733.dkr.ecr.eu-central-1.amazonaws.com/cloud-game/consumer
steps:
- uses: actions/checkout@master
- name: Authenticate
# if: github.ref == 'refs/heads/main'
run: ./.github/scripts/auth.sh
env:
AWS_ACCESS_KEY_ID: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: eu-central-1
ECR_ACCOUNT: 220002198733.dkr.ecr.eu-central-1.amazonaws.com
- name: Build Docker Container
run: |
docker build -t $IMAGE:$GITHUB_RUN_ID -f async-server-provisioner/Dockerfile .
- 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