diff --git a/.github/workflows/docker-caddy.yml b/.github/workflows/docker-caddy.yml new file mode 100644 index 0000000..03c0277 --- /dev/null +++ b/.github/workflows/docker-caddy.yml @@ -0,0 +1,32 @@ +name: Docker Image CI Caddy + +on: + push: + branches: [ "master" ] + paths: + - 'update_caddyfile.sh' + - 'Dockerfile-caddy' + +jobs: + build-server: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Docker Login + uses: docker/login-action@v3.2.0 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build and push Server + uses: docker/build-push-action@v6.1.0 + with: + context: . + platforms: linux/amd64,linux/arm64 + file: Dockerfile-caddy + push: true + tags: gstein17/roboscapesim-rs-caddy:latest + diff --git a/Caddyfile.template b/Caddyfile.template index 4882e7c..01da8f6 100644 --- a/Caddyfile.template +++ b/Caddyfile.template @@ -1,3 +1,7 @@ +{ + cert_issuer zerossl ZEROSSL_API_KEY +} + DASH_IP.roboscapeonlineservers.netsblox.org { reverse_proxy :15000 } diff --git a/update_caddyfile.sh b/update_caddyfile.sh index c6e8031..e1e4a40 100644 --- a/update_caddyfile.sh +++ b/update_caddyfile.sh @@ -2,3 +2,4 @@ DASH_IP="`curl -s http://checkip.amazonaws.com | cut -d " " -f 2 | tr . -`" cp Caddyfile.template Caddyfile sed -i -e "s/DASH_IP/$DASH_IP/g" Caddyfile +sed -i -e "s/ZEROSSL_API_KEY/$ZEROSSL_API_KEY/g" Caddyfile