@@ -107,36 +107,56 @@ jobs:
107107 run : |
108108 find . -name '*.adoc' -type f -delete
109109
110- - name : Upload documentation artifact
111- uses : actions/upload-pages-artifact@v4 # https://github.com/actions/upload-pages-artifact
112- with :
113- path : ./
110+ # Push to gh-pages branch. This parts needs permissions contents: write.
111+ - name : Push to gh-pages
112+ if : github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
113+ run : |
114+ git fetch origin
115+ echo "checkout gh-pages branch without history (orphan)"
116+ git checkout --orphan gh-pages
117+ echo "remove all asciidoc (.adoc) source files"
118+ git ls-files | grep '\.adoc$' | xargs git rm --cached || true
119+ echo "remove unnecessary files"
120+ git rm .gitattributes
121+ echo "add & commit everything new"
122+ git add --all
123+ git commit -m "Updated Documentation. [skip ci]" || true
124+ git push origin gh-pages --force
125+ env :
126+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
114127
115- # ---------------------------------------------------------------------------------------
128+ # This step is only required, when using the deploy step below.
129+ # Requires setting: Settings → Pages → Source: GitHub Actions
130+ # - name: Upload documentation artifact
131+ # uses: actions/upload-pages-artifact@v4 # https://github.com/actions/upload-pages-artifact
132+ # with:
133+ # path: ./
116134
117- deploy :
135+ # # ---------------------------------------------------------------------------------------
118136
119- # ---------------------------------------------------------------------------------------
137+ # deploy:
120138
121- needs : build
122- if : github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
139+ # # ---------------------------------------------------------------------------------------
123140
124- # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
125- permissions :
126- contents : read
127- pages : write # to deploy to Pages
128- id-token : write # to verify the deployment originates from an appropriate source
141+ # needs: build
142+ # if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
129143
130- runs-on : ubuntu-latest
144+ # # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
145+ # permissions:
146+ # contents: read
147+ # pages: write # to deploy to Pages
148+ # id-token: write # to verify the deployment originates from an appropriate source
131149
132- environment :
133- name : github-pages
134- url : ${{ steps.deployment.outputs.page_url }}
150+ # runs-on: ubuntu-latest
135151
136- steps :
137- - name : Setup GitHub Pages
138- uses : actions/configure-pages@v5 # https://github.com/actions/configure-pages
152+ # environment:
153+ # name: github-pages
154+ # url: ${{ steps.deployment.outputs.page_url }}
155+
156+ # steps:
157+ # - name: Setup GitHub Pages
158+ # uses: actions/configure-pages@v5 # https://github.com/actions/configure-pages
139159
140- - name : Deploy to GitHub Pages
141- id : deployment
142- uses : actions/deploy-pages@v4 # https://github.com/actions/deploy-pages
160+ # - name: Deploy to GitHub Pages
161+ # id: deployment
162+ # uses: actions/deploy-pages@v4 # https://github.com/actions/deploy-pages
0 commit comments