|
5 | 5 | branches: |
6 | 6 | - 'dev/feature' |
7 | 7 | - 'dev/patch' |
8 | | - - 'enhancement/**' |
9 | 8 | - 'feature/**' |
10 | | - - 'fix/**' |
11 | 9 | tags-ignore: |
12 | 10 | - '**' |
13 | 11 |
|
14 | 12 | jobs: |
15 | | - nightly-docs: |
16 | | - if: "!contains(toJSON(github.event.commits.*.message), '[ci skip]')" |
17 | | - runs-on: ubuntu-latest |
18 | | - steps: |
19 | | - - name: Configure workflow |
20 | | - id: configuration |
21 | | - env: |
22 | | - DOCS_DEPLOY_KEY: ${{ secrets.DOCS_DEPLOY_KEY }} |
23 | | - run: | |
24 | | - if [ -n "$DOCS_DEPLOY_KEY" ] |
25 | | - then |
26 | | - echo "DOCS_DEPLOY_KEY_PRESENT=true" >> $GITHUB_OUTPUT |
27 | | - else |
28 | | - echo "Secret 'DOCS_DEPLOY_KEY' not present. Exiting job." |
29 | | - fi |
30 | | - BRANCH_NAME="${GITHUB_REF#refs/*/}" |
31 | | - echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_OUTPUT |
32 | | - echo "DOCS_OUTPUT_DIR=${GITHUB_WORKSPACE}/skript-docs/docs/nightly/${BRANCH_NAME}" >> $GITHUB_OUTPUT |
33 | | - echo "DOCS_REPO_DIR=${GITHUB_WORKSPACE}/skript-docs" >> $GITHUB_OUTPUT |
34 | | - echo "SKRIPT_REPO_DIR=${GITHUB_WORKSPACE}/skript" >> $GITHUB_OUTPUT |
35 | | - - name: Checkout Skript |
36 | | - uses: actions/checkout@v6 |
37 | | - with: |
38 | | - submodules: recursive |
39 | | - path: skript |
40 | | - - name: Setup documentation environment |
41 | | - if: steps.configuration.outputs.DOCS_DEPLOY_KEY_PRESENT == 'true' |
42 | | - uses: ./skript/.github/workflows/docs/setup-docs |
43 | | - with: |
44 | | - docs_deploy_key: ${{ secrets.DOCS_DEPLOY_KEY }} |
45 | | - docs_output_dir: ${{ steps.configuration.outputs.DOCS_OUTPUT_DIR }} |
46 | | - - name: Generate documentation |
47 | | - id: generate |
48 | | - if: steps.configuration.outputs.DOCS_DEPLOY_KEY_PRESENT == 'true' |
49 | | - uses: ./skript/.github/workflows/docs/generate-docs |
50 | | - with: |
51 | | - docs_output_dir: ${{ steps.configuration.outputs.DOCS_OUTPUT_DIR }} |
52 | | - docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }} |
53 | | - skript_repo_dir: ${{ steps.configuration.outputs.SKRIPT_REPO_DIR }} |
54 | | - - name: Push nightly documentation |
55 | | - if: steps.generate.outputs.DOCS_CHANGED == 'true' |
56 | | - uses: ./skript/.github/workflows/docs/push-docs |
57 | | - with: |
58 | | - docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }} |
59 | | - git_name: Nightly Docs Bot |
60 | | - git_email: nightlydocs@skriptlang.org |
61 | | - git_commit_message: "Update ${{ steps.configuration.outputs.BRANCH_NAME }} branch nightly docs to ${{ github.repository }}@${{ github.sha }}" |
| 13 | + nightly-docs: |
| 14 | + if: "!contains(toJSON(github.event.commits.*.message), '[ci skip]')" |
| 15 | + runs-on: ubuntu-latest |
| 16 | + steps: |
| 17 | + - name: Configure workflow |
| 18 | + id: configuration |
| 19 | + run: | |
| 20 | + BRANCH_NAME="${GITHUB_REF#refs/*/}" |
| 21 | + echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_OUTPUT |
| 22 | + echo "DOCS_OUTPUT_DIR=${GITHUB_WORKSPACE}/skript-docs/docs/nightly/${BRANCH_NAME}" >> $GITHUB_OUTPUT |
| 23 | + echo "DOCS_REPO_DIR=${GITHUB_WORKSPACE}/skript-docs" >> $GITHUB_OUTPUT |
| 24 | + echo "SKRIPT_REPO_DIR=${GITHUB_WORKSPACE}/skript" >> $GITHUB_OUTPUT |
| 25 | + - name: Checkout Skript |
| 26 | + uses: actions/checkout@v6 |
| 27 | + with: |
| 28 | + submodules: recursive |
| 29 | + path: skript |
| 30 | + - name: Setup documentation environment |
| 31 | + uses: ./skript/.github/workflows/docs/setup-docs |
| 32 | + with: |
| 33 | + docs_repo: "SkriptLang/skript-docs" |
| 34 | + docs_token: ${{ secrets.DOCS_TOKEN }} |
| 35 | + - name: Generate documentation |
| 36 | + id: generate |
| 37 | + uses: ./skript/.github/workflows/docs/generate-docs |
| 38 | + with: |
| 39 | + docs_output_dir: ${{ steps.configuration.outputs.DOCS_OUTPUT_DIR }} |
| 40 | + docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }} |
| 41 | + skript_repo_dir: ${{ steps.configuration.outputs.SKRIPT_REPO_DIR }} |
| 42 | + - name: Push nightly documentation |
| 43 | + if: steps.generate.outputs.DOCS_CHANGED == 'true' |
| 44 | + uses: ./skript/.github/workflows/docs/push-docs |
| 45 | + with: |
| 46 | + docs_repo_dir: ${{ steps.configuration.outputs.DOCS_REPO_DIR }} |
| 47 | + git_name: Nightly Docs Bot |
| 48 | + git_email: nightlydocs@skriptlang.org |
| 49 | + git_commit_message: "Update ${{ steps.configuration.outputs.BRANCH_NAME }} branch nightly docs to ${{ github.repository }}@${{ github.sha }}" |
0 commit comments