chore(build): Build for J21 #149
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
name: "deploy" | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "main" ] | |
tags-ignore: [ "**" ] | |
concurrency: | |
group: ${{ github.ref }}-build | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: "ubuntu-latest" | |
environment: | |
name: "production" | |
url: "https://webui.advntr.dev" | |
steps: | |
- name: "setup env" | |
id: "setup" | |
uses: "KyoriPowered/.github/.github/actions/setup-java-env@trunk" | |
with: | |
runtime_version: 21 | |
publishing_branch_regex: "main" | |
gradle_warning_mode: "all" | |
- name: "build for production" | |
run: "./gradlew build" | |
- name: "setup / ssh" | |
uses: "webfactory/ssh-agent@v0.8.0" | |
with: | |
ssh-private-key: "${{ secrets.DOCKER_HOST_SSH_KEY }}" | |
- name: "setup / login to ghcr" | |
uses: "docker/login-action@v3.0.0" | |
with: | |
registry: "ghcr.io" | |
username: "${{ github.actor }}" | |
password: "${{ secrets.GITHUB_TOKEN }}" | |
- name: "publish / docker image" | |
run: "./gradlew jib -Djib.console=plain" | |
- name: "publish / deploy to production" | |
env: | |
DOCKER_HOST: "${{ secrets.DOCKER_HOST }}" | |
run: | | |
echo ${{ secrets.DOCKER_HOST_SSH_SIG }} > ~/.ssh/known_hosts | |
docker stack deploy --with-registry-auth --compose-file=docker-compose.yml adventure-webui |