Skip to content

Commit

Permalink
Allow dry-running CD.yml and fix syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
FWDekker committed Sep 29, 2024
1 parent f5c0e51 commit 68e251c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,24 @@ on:
release:
types: [ published ]
workflow_dispatch:
inputs:
dry_run:
description: 'dry run'
type: boolean
default: true

jobs:
pre-flight-checks:
if: "!(contains(github.event.head_commit.message, '[cd skip]') || contains(github.event.head_commit.message, '[skip cd]'))"
runs-on: ubuntu-latest

steps:
- name: Print inputs
run: |
echo "dry_run: ${{ github.event.inputs.dry_run }}"
build-pages:
needs: [ pre-flight-checks ]
runs-on: ubuntu-latest

steps:
Expand All @@ -32,7 +47,6 @@ jobs:
java-version: '17'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
working-directory: main/
with:
add-job-summary: on-failure

Expand All @@ -50,6 +64,7 @@ jobs:
mv main/build/dokka/html/* gh-pages/
- name: Push new documentation
if: ${{ github.event.inputs.dry_run == 'false' }}
working-directory: gh-pages/
run: |
git config --global user.name "FWDekkerBot"
Expand Down

0 comments on commit 68e251c

Please sign in to comment.