Skip to content

Commit

Permalink
fix: changed automation method
Browse files Browse the repository at this point in the history
  • Loading branch information
Vicente-G committed Dec 11, 2023
1 parent a7ec2a1 commit 22ee9e5
Showing 1 changed file with 33 additions and 44 deletions.
77 changes: 33 additions & 44 deletions .github/workflows/deploy.yml
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

0 comments on commit 22ee9e5

Please sign in to comment.