Build Images #580
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: Build Images | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
schedule: | |
# every monday morning at 04:30 | |
- cron: '30 4 * * 1' | |
workflow_dispatch: | |
inputs: | |
game: | |
description: 'Name of the game' | |
required: true | |
type: choice | |
options: | |
- bf1942 | |
- bf2 | |
- cmw | |
- cod2 | |
- cod4 | |
- cod5 | |
- cs2 | |
- tf2 | |
jobs: | |
# prerequisites | |
check-requirements: | |
name: Check requirements | |
runs-on: ubuntu-20.04 | |
outputs: | |
changed-files-list: ${{ steps.check-changed-files.outputs.changed-files-list }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Store changed files list | |
id: check-changed-files | |
run: | | |
echo 'changed-files-list<<EOF' >> $GITHUB_OUTPUT | |
git show --name-only --pretty=format: ${{ github.sha }} >> $GITHUB_OUTPUT | |
echo 'EOF' >> $GITHUB_OUTPUT | |
- name: Output changed files list | |
run: > | |
echo "${{ steps.check-changed-files.outputs.changed-files-list }}" | |
# games | |
build-bf1942: | |
name: Battlefield 1942 | |
needs: check-requirements | |
if: contains(needs.check-requirements.outputs.changed-files-list, 'bf1942') || inputs.game == 'bf1942' || github.event_name == 'schedule' | |
uses: ./.github/workflows/_linux.yml | |
with: | |
name: bf1942 | |
description: "Battlefield 1942 game server. Updated automatically." | |
secrets: | |
gcloud_key: ${{ secrets.GCLOUD_KEY }} | |
gcloud_project: ${{ secrets.GCLOUD_PROJECT }} | |
docker_username: ${{ secrets.DOCKER_USERNAME }} | |
docker_password: ${{ secrets.DOCKER_PASSWORD }} | |
build-bf2: | |
name: Battlefield 2 | |
needs: check-requirements | |
if: contains(needs.check-requirements.outputs.changed-files-list, 'bf2') || inputs.game == 'bf2' || github.event_name == 'schedule' | |
uses: ./.github/workflows/_linux.yml | |
with: | |
name: bf2 | |
description: "Battlefield 2 game server. Updated automatically." | |
secrets: | |
gcloud_key: ${{ secrets.GCLOUD_KEY }} | |
gcloud_project: ${{ secrets.GCLOUD_PROJECT }} | |
docker_username: ${{ secrets.DOCKER_USERNAME }} | |
docker_password: ${{ secrets.DOCKER_PASSWORD }} | |
build-cmw: | |
name: Chivalry Medieval Warfare | |
needs: check-requirements | |
if: contains(needs.check-requirements.outputs.changed-files-list, 'cmw') || inputs.game == 'cmw' || github.event_name == 'schedule' | |
uses: ./.github/workflows/_linux.yml | |
with: | |
name: cmw | |
description: "Chivalry Medieval Warfare game server. Updated automatically." | |
secrets: | |
gcloud_key: ${{ secrets.GCLOUD_KEY }} | |
gcloud_project: ${{ secrets.GCLOUD_PROJECT }} | |
docker_username: ${{ secrets.DOCKER_USERNAME }} | |
docker_password: ${{ secrets.DOCKER_PASSWORD }} | |
build-cod2: | |
name: Call of Duty 2 | |
needs: check-requirements | |
if: contains(needs.check-requirements.outputs.changed-files-list, 'cod2') || inputs.game == 'cod2' || github.event_name == 'schedule' | |
uses: ./.github/workflows/_linux.yml | |
with: | |
name: cod2 | |
description: "Call of Duty 2 game server. Updated automatically." | |
secrets: | |
gcloud_key: ${{ secrets.GCLOUD_KEY }} | |
gcloud_project: ${{ secrets.GCLOUD_PROJECT }} | |
docker_username: ${{ secrets.DOCKER_USERNAME }} | |
docker_password: ${{ secrets.DOCKER_PASSWORD }} | |
build-cod4: | |
name: Call of Duty 4 | |
needs: check-requirements | |
if: contains(needs.check-requirements.outputs.changed-files-list, 'cod4') || inputs.game == 'cod4' || github.event_name == 'schedule' | |
uses: ./.github/workflows/_linux.yml | |
with: | |
name: cod4 | |
description: "Call of Duty 4 game server. Updated automatically." | |
secrets: | |
gcloud_key: ${{ secrets.GCLOUD_KEY }} | |
gcloud_project: ${{ secrets.GCLOUD_PROJECT }} | |
docker_username: ${{ secrets.DOCKER_USERNAME }} | |
docker_password: ${{ secrets.DOCKER_PASSWORD }} | |
build-cod5: | |
name: Call of Duty 5 | |
needs: check-requirements | |
if: contains(needs.check-requirements.outputs.changed-files-list, 'cod5') || inputs.game == 'cod5' || github.event_name == 'schedule' | |
uses: ./.github/workflows/_linux.yml | |
with: | |
name: cod5 | |
description: "Call of Duty 5 game server. Updated automatically." | |
secrets: | |
gcloud_key: ${{ secrets.GCLOUD_KEY }} | |
gcloud_project: ${{ secrets.GCLOUD_PROJECT }} | |
docker_username: ${{ secrets.DOCKER_USERNAME }} | |
docker_password: ${{ secrets.DOCKER_PASSWORD }} | |
build-cs2: | |
name: Counter-Strike 2 | |
needs: check-requirements | |
if: contains(needs.check-requirements.outputs.changed-files-list, 'cs2') || inputs.game == 'cs2' || github.event_name == 'schedule' | |
uses: ./.github/workflows/_linux.yml | |
with: | |
name: cs2 | |
description: "Counter-Strike 2 game server. Updated automatically." | |
secrets: | |
gcloud_key: ${{ secrets.GCLOUD_KEY }} | |
gcloud_project: ${{ secrets.GCLOUD_PROJECT }} | |
docker_username: ${{ secrets.DOCKER_USERNAME }} | |
docker_password: ${{ secrets.DOCKER_PASSWORD }} | |
build-tf2: | |
name: Team Fortress 2 | |
needs: check-requirements | |
if: contains(needs.check-requirements.outputs.changed-files-list, 'tf2') || inputs.game == 'tf2' || github.event_name == 'schedule' | |
uses: ./.github/workflows/_linux.yml | |
with: | |
name: tf2 | |
description: "Team Fortress 2 game server. Updated automatically." | |
secrets: | |
gcloud_key: ${{ secrets.GCLOUD_KEY }} | |
gcloud_project: ${{ secrets.GCLOUD_PROJECT }} | |
docker_username: ${{ secrets.DOCKER_USERNAME }} | |
docker_password: ${{ secrets.DOCKER_PASSWORD }} |