-
Notifications
You must be signed in to change notification settings - Fork 392
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bot build: add workflow to publish docker container of headless-game-…
…runner (bot)
- Loading branch information
1 parent
aad9b09
commit 099ce07
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Runs when master branch is updated. | ||
# Creates & pushes a docker container for bots. | ||
|
||
name: Master Branch Build - Build Bot Docker Container | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
build: | ||
env: | ||
IS_MASTER_BUILD: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | ||
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: Login to GitHub Container Registry | ||
if: ${{ env.IS_MASTER_BUILD }} | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: build headless docker container | ||
if: ${{ env.IS_MASTER_BUILD }} | ||
run: | | ||
./gradlew :game-app:game-headless:shadowJar | ||
docker build game-app/game-headless --tag ghcr.io/triplea-game/bot:latest | ||
docker push ghcr.io/triplea-game/bot:latest |