v1.15.1 #40
Workflow file for this run
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: Deploy | |
| on: | |
| release: | |
| types: | |
| - created | |
| jobs: | |
| check-requirements: | |
| name: Check Requirements | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Set Version Tag | |
| run: echo "API_TAG=$(echo $GITHUB_REF | awk -F '/' '{print $NF}')" >> $GITHUB_ENV | |
| - name: Check Tag Convention | |
| run: '[[ "${API_TAG:0:1}" == "v" ]] || exit 1' | |
| build-image: | |
| name: Build Image | |
| runs-on: ubuntu-24.04 | |
| needs: check-requirements | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Parse API Version | |
| run: echo "API_VERSION=$(echo $GITHUB_REF | awk -F '/' '{print $NF}' | cut -c 2-)" >> $GITHUB_ENV | |
| - name: Docker Login | |
| run: | | |
| echo ${{ secrets.DOCKER_ACCESS_TOKEN }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin | |
| echo ${{ secrets.GHCRIO_ACCESS_TOKEN }} | docker login ghcr.io -u ${{ secrets.GHCRIO_USERNAME }} --password-stdin | |
| - name: Build Image | |
| run: docker build -t steamcmd/api:latest -t ghcr.io/steamcmd/api:latest . | |
| # deploy | |
| - name: Tag Image | |
| run: | | |
| docker tag steamcmd/api:latest steamcmd/api:$API_VERSION | |
| docker tag ghcr.io/steamcmd/api:latest ghcr.io/steamcmd/api:$API_VERSION | |
| - name: Push Image | |
| run: | | |
| docker push steamcmd/api --all-tags | |
| docker push ghcr.io/steamcmd/api --all-tags | |
| update-readme: | |
| name: Update Readme | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Update Docker Hub Description | |
| uses: peter-evans/dockerhub-description@v4 | |
| env: | |
| DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
| DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
| DOCKERHUB_REPOSITORY: steamcmd/api |