forked from qld-gov-au/qgds-bootstrap5
-
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.
Use github actions for pages deployment
- Loading branch information
Showing
1 changed file
with
31 additions
and
10 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,24 +1,34 @@ | ||
name: Storybook deploy | ||
|
||
on: | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
workflow_run: | ||
workflows: [Build and Test] # Reuse the name of your tests workflow | ||
branches: [main, develop] | ||
types: [completed ] | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: deploy-${{ github.workflow }}-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession. | ||
cancel-in-progress: true | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
deploy: | ||
|
||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: [ '20' ] | ||
name: Deploy with Node ${{ matrix.node }} | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
|
@@ -69,11 +79,22 @@ jobs: | |
with: | ||
name: Storybook | ||
path: storybook-static | ||
- name: Deploy 🚀 | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
|
||
- name: Setup Pages | ||
uses: actions/configure-pages@v4 | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH: gh-pages # The branch the action should deploy to. | ||
FOLDER: storybook-static # The folder that the build-storybook script generates files. | ||
CLEAN: true # Automatically remove deleted files from the deploy branch | ||
TARGET_FOLDER: docs # The folder that we serve our Storybook files from | ||
path: "./storybook-static" | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/[email protected] | ||
|
||
# - name: Deploy 🚀 #to branch for old website deployment | ||
# uses: JamesIves/github-pages-deploy-action@v4 | ||
# with: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# BRANCH: gh-pages # The branch the action should deploy to. | ||
# FOLDER: storybook-static # The folder that the build-storybook script generates files. | ||
# CLEAN: true # Automatically remove deleted files from the deploy branch | ||
# TARGET_FOLDER: docs # The folder that we serve our Storybook files from |