only overwrite game files when update is available #7
This file contains hidden or 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: "Build Hytale" | |
| on: | |
| schedule: | |
| - cron: 0 0 * * 0 | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "hytale/**" | |
| env: | |
| GAME: hytale | |
| VERSION: 1 | |
| DOCKER_HUB_DESCRIPTION: "Hytale game server" | |
| jobs: | |
| build-and-deploy: | |
| name: Build and push Docker image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
| - name: Build and push | |
| uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6 | |
| with: | |
| context: ./${{ env.GAME }} | |
| push: true | |
| tags: >- | |
| ipshosting/game-${{ env.GAME }}:latest, | |
| ipshosting/game-${{ env.GAME }}:v${{ env.VERSION }} | |
| - name: Update DockerHub description | |
| uses: peter-evans/dockerhub-description@1b9a80c056b620d92cedb9d9b5a223409c68ddfa # v5 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
| repository: ipshosting/game-${{ env.GAME }} | |
| short-description: ${{ env.DOCKER_HUB_DESCRIPTION }} | |
| readme-filepath: ./${{ env.GAME }}/README.md |