Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 6 additions & 48 deletions .github/workflows/auto-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ name: Auto Deploy

on:
schedule:
- cron: '*/5 * * * *'
- cron: '23 * * * *'

repository_dispatch:
types: [cfw-deadlock-updated]

workflow_dispatch:
inputs:
Expand All @@ -16,33 +19,11 @@ on:
default: false

jobs:
check-commit:
name: Check for new commit to SteamDB repo
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.compare.outputs.changed }}
latest_commit_sha: ${{ steps.remote_shas.outputs.steamdb_sha }}
steps:
- name: Get latest remote commit hashes
id: remote_shas
run: |
steamdb_sha=$(git ls-remote https://github.com/SteamDatabase/GameTracking-Deadlock.git HEAD | cut -f1)
echo "steamdb_sha=$steamdb_sha" >> "$GITHUB_OUTPUT"

- name: Compare against last known commits
id: compare
run: |
if [ "${{ steps.remote_shas.outputs.steamdb_sha }}" != "${{ vars.LAST_STEAMDB_SHA }}" ]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
fi

check-version:
name: Check if deadlock version changed
runs-on: ubuntu-latest
needs: check-commit
if: ${{ needs.check-commit.outputs.changed == 'true' || github.event.inputs.force == 'true' }}
# force will trigger deploy jobs regardless, so no point checking version
if: ${{ github.event.inputs.force == 'false' }}
outputs:
new_version: ${{ steps.check_version.outputs.new_version }}
steps:
Expand Down Expand Up @@ -119,26 +100,3 @@ jobs:
STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }}
STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }}
BOT_WIKI_PASS: ${{ secrets.BOT_WIKI_PASS }}

save-variables:
name: Save variables for next run
runs-on: ubuntu-latest
needs: [check-commit, deploy-develop, deploy-master]
if: >-
${{
always() &&
needs.check-commit.outputs.changed == 'true' &&
needs.deploy-develop.result != 'failure' &&
needs.deploy-develop.result != 'cancelled' &&
needs.deploy-master.result != 'failure' &&
needs.deploy-master.result != 'cancelled'
}}
steps:
- name: Checkout Deadbot repo
uses: actions/checkout@v6

- name: Save latest SteamDB commit sha as a repo variable
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
gh variable set LAST_STEAMDB_SHA -b "${{ needs.check-commit.outputs.latest_commit_sha }}"
Loading