Skip to content

Commit

Permalink
Deploy docs to GitHub Pages (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankieroberto authored Sep 4, 2023
1 parent 94c0e2b commit 43fd433
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
48 changes: 48 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: deploy

on:
push:
branches:
- main

# Enable running this workflow manually from the Actions tab
workflow_dispatch:

# Set permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: pages
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Use docs folder
run: cd docs/
- name: Install dependencies
run: npm ci
- name: Build with Eleventy
run: npm run-script build
- name: Upload artifact
uses: actions/upload-pages-artifact@v1

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
6 changes: 5 additions & 1 deletion docs/eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ module.exports = function(eleventyConfig) {
dir: {
// Use layouts from the plugin
layouts: 'node_modules/@x-govuk/govuk-eleventy-plugin/layouts'
}
},
pathPrefix: process.env.GITHUB_ACTIONS
? '/govuk-rspec-helpers/'
: '/'
}
}
};

0 comments on commit 43fd433

Please sign in to comment.