-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (48 loc) · 1.84 KB
/
master.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
# Runs when master branch is updated.
# Does all the builds things & creates a new latest build.
# Then updates production to be running this new latest build.
name: Build latest and update PROD
on:
pull_request:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
- name: Run Build Checks
# We skip 'spotlessApply' such that only 'spotlessCheck' will run to validate formatting.
# This is a good setup for a CI server, meanwhile if a developer runs 'verify', they
# will have the 'spotlessApply' task run to automatically format the code.
run: ./verify.sh --exclude-task spotlessApply
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build docker container
run: |
docker build . --tag ghcr.io/triplea-game/lobby:latest
docker push ghcr.io/triplea-game/lobby:latest
# - name: Load SSH private key into ssh-agent
# uses: webfactory/ssh-agent@v0.9.0
# with:
# ssh-private-key: ${{ secrets.ANSIBLE_SSH_PRIVATE_KEY }}
# - name: Run Ansible to Deploy (or do something here like invoke infrastructure, or do a quick SSH command for a service restart)
# run: |
# pip install ansible==2.9.13
# cd infrastructure
# echo "$ANSIBLE_VAULT_PASSWORD" > vault_password
# ./run_ansible --environment production
# env:
# ANSIBLE_VAULT_PASSWORD: ${{ secrets.ANSIBLE_VAULT_PASSWORD }}