Nightly #98
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: Nightly | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| - "feature/*" | |
| pull_request: | |
| branches: [ "main" ] | |
| schedule: | |
| - cron: '0 0 * * *' # This cron expression schedules the workflow to run every day at midnight UTC | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| steamcmd_version: ${{ steps.get_version.outputs.steamcmd_version }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUBTOKEN }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
| with: | |
| images: ghcr.io/gameservercentral/steamcmd-docker | |
| - name: Extract SteamCMD version | |
| id: get_version | |
| run: | | |
| sudo add-apt-repository multiverse | |
| sudo dpkg --add-architecture i386 | |
| sudo apt update | |
| version=$(apt show steamcmd | grep Version | sed 's/^Version: //' ) | |
| clean_version=$(echo $version | sed 's/[^a-z0-9._-]//g') | |
| echo "steamcmd_version is available in $version. Cleaned version for docker is $clean_version" | |
| echo "::set-output name=steamcmd_version::$clean_version" | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
| with: | |
| context: . | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: | | |
| ghcr.io/gameservercentral/steamcmd:latest | |
| ghcr.io/gameservercentral/steamcmd:nightly | |
| ghcr.io/gameservercentral/steamcmd:${{ steps.get_version.outputs.steamcmd_version }} | |
| labels: ${{ steps.meta.outputs.labels }} |