Skip to content

Commit a9fcbf7

Browse files
authored
Update build.yml
1 parent 542e7f4 commit a9fcbf7

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

.github/workflows/build.yml

+16-10
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,18 @@ name: Build documentation
22

33
on:
44
push:
5-
# To trigger the workflow once you push to the `main` branch
6-
# Replace `main` with your branch’s name
7-
branches: ["main"]
8-
# Specify to run a workflow manually from the Actions tab on GitHub
5+
branches:
6+
- main
7+
- '*'
98
workflow_dispatch:
109

1110
permissions:
1211
id-token: write
1312
pages: write
1413

1514
env:
16-
# Name of module and id separated by a slash
1715
INSTANCE: Writerside/LewMCWiki
18-
# Replace XX with the ID of the instance in capital letters
1916
ARTIFACT: webHelpLEWMCWIKI2-all.zip
20-
# Docker image version
2117
DOCKER_VERSION: 241.15989
2218

2319
jobs:
@@ -49,7 +45,6 @@ jobs:
4945
environment:
5046
name: github-pages
5147
url: ${{ steps.deployment.outputs.page_url }}
52-
# Requires build job results
5348
needs: build
5449
runs-on: ubuntu-latest
5550

@@ -65,11 +60,22 @@ jobs:
6560
- name: Setup Pages
6661
uses: actions/[email protected]
6762

68-
- name: Upload artifact
63+
- name: Determine Deployment Path
64+
id: deployment-path
65+
run: |
66+
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
67+
echo "DEPLOY_PATH=." >> $GITHUB_ENV
68+
else
69+
BRANCH_NAME=$(echo "${{ github.ref }}" | sed 's/refs\/heads\///')
70+
echo "DEPLOY_PATH=${BRANCH_NAME}" >> $GITHUB_ENV
71+
fi
72+
73+
- name: Upload artifact to Pages
6974
uses: actions/[email protected]
7075
with:
7176
path: dir
77+
deployment-path: ${{ env.DEPLOY_PATH }}
7278

7379
- name: Deploy to GitHub Pages
7480
id: deployment
75-
uses: actions/[email protected]
81+
uses: actions/[email protected]

0 commit comments

Comments
 (0)