-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
33 additions
and
44 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 |
---|---|---|
@@ -1,50 +1,39 @@ | ||
name: Deploy to Github Pages | ||
name: Build and Deploy | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: "pages-deployment" | ||
cancel-in-progress: false | ||
contents: write | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
container: | ||
image: ghcr.io/avisi-cloud/structurizr-site-generatr | ||
options: --user root | ||
steps: | ||
- name: Git Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build Site with Generatr | ||
run: | | ||
/opt/structurizr-site-generatr/bin/structurizr-site-generatr generate-site \ | ||
-w src/workspace.dsl \ | ||
--assets-dir src/assets \ | ||
--branches main \ | ||
--default-branch main | ||
- name: Setup Github Pages | ||
if: ${{ success() }} | ||
uses: actions/configure-pages@v3 | ||
|
||
- name: Upload Artifact | ||
if: ${{ success() }} | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: 'build/site' | ||
|
||
- name: Deploy to GitHub Pages | ||
if: ${{ success() }} | ||
id: deployment | ||
uses: actions/deploy-pages@v2 | ||
deploy_github_pages: | ||
runs-on: macos-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '19' | ||
|
||
- name: Install dependencies | ||
run: | | ||
brew tap avisi-cloud/tools | ||
brew install structurizr-site-generatr | ||
- name: Build the site | ||
run: structurizr-site-generatr generate-site \ | ||
-w src/workspace.dsl \ | ||
--assets-dir src/assets \ | ||
--branches main \ | ||
--default-branch main | ||
|
||
- name: Deploy 🚀 | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
branch: gh-pages | ||
folder: build/site | ||
clean: true |