diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3268246..c96ffcb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -43,7 +43,14 @@ jobs: name: Version run: echo "VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> ${GITHUB_OUTPUT} - - name: Build Container + - name: Build unstable Container + if: github.ref_name != 'main' + run: | + echo ${{secrets.PACKAGES_TOKEN}} | docker login --username ${{ secrets.PACKAGES_USER }} --password-stdin git.arindy.de + docker build -f src/main/docker/Dockerfile.native-micro -t git.arindy.de/arindy/dice-tower:unstable -t git.arindy.de/arindy/dice-tower:${{ steps.version.outputs.VERSION }} . + docker push git.arindy.de/arindy/dice-tower:unstable + + - name: Build stable Container if: github.ref_name == 'main' run: | echo ${{secrets.PACKAGES_TOKEN}} | docker login --username ${{ secrets.PACKAGES_USER }} --password-stdin git.arindy.de @@ -51,10 +58,28 @@ jobs: docker push git.arindy.de/arindy/dice-tower:${{ steps.version.outputs.VERSION }} docker push git.arindy.de/arindy/dice-tower:latest + - name: Prepare deploy + run: | + echo ${{secrets.SSH_KNOWN_HOSTS}} >> ~/.ssh/known_hosts + base64 -d <<< ${{secrets.SSH_KEY}} > ./.key + chmod 600 ./.key + + - name: Deploy unstable + if: github.ref_name != 'main' + run: "ssh -i ./.key dice-tower@${{secrets.SSH_HOST}} 'docker compose -f compose.unstable.yml up --force-recreate -d' " + - name: Deploy + if: github.ref_name == 'main' + run: "ssh -i ./.key dice-tower@${{secrets.SSH_HOST}} 'docker compose -f compose.yml up --force-recreate -d' " + + - name: Deploy local if: github.ref_name == 'main' run: "docker compose up -d" + - name: clean up + run: | + rm ./.key + - name: create tag if: github.ref_name == 'main' run: | diff --git a/.gitignore b/.gitignore index f656fab..39205c8 100644 --- a/.gitignore +++ b/.gitignore @@ -124,3 +124,5 @@ fabric.properties # Android studio 3.1+ serialized cache file .idea/caches/build_file_checksums.ser +.key +.key/ diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 047230c..048e437 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -19,6 +19,8 @@