Pin drupal to 11.1.8 to address finder app static site generation issue #66
This file contains hidden or 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
| on: ["push", "workflow_dispatch"] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build static site | |
| run: | | |
| docker compose run static -l ${GITHUB_PAGES_URL} | |
| sudo find html \( -name '*.html' -o -name '*.css' \) -exec sed -i'' -e 's#action="/#action="/CD-finder/g#' -e 's#href="/#href="/CD-finder/#g' -e 's#(/modules/#(/CD-finder/modules/#g' -e 's#(/core/#(/CD-finder/core/#g' -e 's#src="/#src="/CD-finder/#g' {} + | |
| sudo find html/sites/default/files/js -type f -exec sed -i'' -e $'s#\\([\'"]\\)rest/#\\1CD-finder/rest/#g' {} + | |
| - name: Upload static files as artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: html/ | |
| - name: Deploy to branch | |
| # only if default branch | |
| if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) | |
| run: | | |
| git config --global user.name 'GitHub Actions' | |
| git config --global user.email 'actions@github.com' | |
| git checkout --orphan static-site | |
| git rm -rf --quiet . | |
| sudo mv html/* . | |
| git add . | |
| git commit -m "Deploy to GitHub Pages" | |
| git push -f origin static-site | |
| - name: Deploy to GitHub Pages | |
| # only if default branch | |
| if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) | |
| uses: actions/deploy-pages@v4 |