Skip to content

Commit

Permalink
Bot build: add workflow to publish docker container of headless-game-…
Browse files Browse the repository at this point in the history
…runner (bot) (#12756)

* Bot build: add workflow to publish docker container of headless-game-runner (bot)

* Don't run on pull request
  • Loading branch information
DanVanAtta committed Jul 23, 2024
1 parent aad9b09 commit 7de5761
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build-headless-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Runs when master branch is updated.
# Creates & pushes a docker container for bots.

name: Master Branch Build - Build Bot Docker Container
on:
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

0 comments on commit 7de5761

Please sign in to comment.