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)
  • Loading branch information
DanVanAtta committed Jul 23, 2024
1 parent aad9b09 commit 099ce07
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build-headless-docker.yml
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

0 comments on commit 099ce07

Please sign in to comment.