v1.13.2 #34
Workflow file for this run
This file contains 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-20.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-20.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-20.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-20.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 }} |