-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP 332 Separate Site generation and publication ...
- Loading branch information
Showing
4 changed files
with
146 additions
and
162 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Generate Site | ||
|
||
on: | ||
pull_request: | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-artifacts: | ||
uses: ./.github/workflows/build-artifacts.yml | ||
with: | ||
# SonarQube requires JDK 17 or higher | ||
java-version: '17' | ||
|
||
generate-site: | ||
needs: build-artifacts | ||
runs-on: ubuntu-latest | ||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.ref }}-${{ inputs.publish_gh_pages }}" | ||
env: | ||
DTC_HEADLESS: true | ||
steps: | ||
- name: Install dot (Graphviz) | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y graphviz | ||
- name: Cache Gradle packages | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.gradle/caches | ||
key: "${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}" | ||
restore-keys: ${{ runner.os }}-gradle | ||
|
||
- name: Cache .doctoolchain | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.doctoolchain | ||
key: "${{ runner.os }}-doctoolchain-${{ hashFiles('**/lockfiles') }}" | ||
restore-keys: ${{ runner.os }}-doctoolchain | ||
|
||
- name: Check out | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: build-artifacts | ||
path: . | ||
|
||
- name: Validate Gradle Wrapper | ||
uses: gradle/actions/wrapper-validation@v4 | ||
|
||
- name: Generate Site | ||
run: ./generate-pages | ||
|
||
- name: 'Publish Test Results' | ||
uses: EnricoMi/publish-unit-test-result-action/linux@v2 | ||
if: always() | ||
with: | ||
files: | | ||
**/build/test-results/**/*.xml | ||
- name: Upload Generated Site | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
name: github-pages | ||
path: public | ||
retention-days: 7 |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Publish GitHub Pages | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish-to-github: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- name: Configure Pages | ||
uses: actions/configure-pages@v5 | ||
|
||
- name: Deploy Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Publish to Netlify | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish-to-netlify: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: netlify | ||
url: ${{ steps.netlify-status.outputs.NETLIFY_DEPLOY_URL }} | ||
steps: | ||
- name: Download Generated Site Artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: github-pages | ||
path: download | ||
|
||
- name: Unpack Generated Site | ||
run: | | ||
mkdir -p public | ||
tar -x -C public -v -f download/artifact.tar | ||
- name: Cache Netlify CLI | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-netlify-cli-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: ${{ runner.os }}-netlify-cli | ||
|
||
- name: Deploy to Netlify | ||
uses: South-Paw/action-netlify-cli@v2 | ||
id: netlify | ||
with: | ||
args: deploy --dir ./public --message 'draft [${{ github.sha }}]' --json | ||
env: | ||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | ||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | ||
|
||
- name: Get Netlify Preview URL | ||
id: netlify-status | ||
run: | | ||
echo "NETLIFY_DEPLOY_URL=${{ fromJson(steps.netlify.outputs.NETLIFY_OUTPUT).deploy_url }}" >> $GITHUB_OUTPUT | ||
echo "The URL where the logs from the deployment can be found" | ||
echo "${{ fromJson(steps.netlify.outputs.NETLIFY_OUTPUT).logs }}" | ||
echo "" | ||
echo "the URL of the draft site that Netlify provides" | ||
echo "${{ fromJson(steps.netlify.outputs.NETLIFY_OUTPUT).deploy_url }}/" |