Skip to content

v1.13.4

v1.13.4 #36

Workflow file for this run

---
name: Deploy
on:
release:
types:
- created
jobs:
check-requirements:
name: Check Requirements
runs-on: ubuntu-22.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-22.04
needs: check-requirements
steps:
- uses: actions/checkout@v3
- 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
- name: Build Image
run: docker build -t steamcmd/api:latest .
# deploy
- name: Tag Image
run: docker tag steamcmd/api:latest steamcmd/api:$API_VERSION
- name: Push Image
run: docker push steamcmd/api --all-tags
update-readme:
name: Update Readme
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Update Docker Hub Description
uses: peter-evans/dockerhub-description@v2
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKERHUB_REPOSITORY: steamcmd/api
deploy-fly:
name: Deploy Fly.io
runs-on: ubuntu-22.04
needs: [check-requirements, build-image]
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- name: Parse API Version
run: echo "API_VERSION=$(echo $GITHUB_REF | awk -F '/' '{print $NF}' | cut -c 2-)" >> $GITHUB_ENV
- name: Deploy API on Fly.io
run: flyctl deploy --app steamcmd --image steamcmd/api:${{ env.API_VERSION }} -e VERSION=${{ env.API_VERSION }}
env:
FLY_API_TOKEN: ${{ secrets.FLY_ACCESS_TOKEN }}
deploy-render:
name: Deploy Render.com
runs-on: ubuntu-22.04
needs: [check-requirements, build-image]
steps:
- uses: actions/checkout@v3
- name: Parse API Version
run: echo "API_VERSION=$(echo $GITHUB_REF | awk -F '/' '{print $NF}' | cut -c 2-)" >> $GITHUB_ENV
- name: Deploy API on Render.com
run: curl https://api.render.com/deploy/${{ secrets.RENDER_SERVICE_ID }}?key=${{ secrets.RENDER_API_KEY }}&imgURL=docker.io%2Fsteamcmd%2Fapi%40${{ env.API_VERSION }}