Skip to content

Merge pull request #533 from alphagov/dependabot-github_actions-actio… #21

Merge pull request #533 from alphagov/dependabot-github_actions-actio…

Merge pull request #533 from alphagov/dependabot-github_actions-actio… #21

Workflow file for this run

---
name: Deploy to GitHub Pages
on:
push:
branches:
- main
workflow_dispatch:
permissions:
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
env:
NODE_VERSION: "12.x"
PYTHON_VERSION: "3.x"
jobs:
deploy:
name: Deploy Tech Docs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- name: Setup Node
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d
with:
node-version: "${{env.NODE_VERSION}}"
- name: Setup Ruby
uses: ruby/setup-ruby@5311f05890856149502132d25c4a24985a00d426
with:
bundler-cache: true
- name: Setup Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1
with:
python-version: "${{env.PYTHON_VERSION}}"
- name: Install Python and Node dependencies
run: |
npm ci
pip install --user -r requirements.txt
- name: Node tests
run: npm test
- name: Python tests
run: |
gem install webrick
make test
- name: Build middleman site
run: make build
- name: Upload artifact
uses: actions/upload-pages-artifact@a753861a5debcf57bf8b404356158c8e1e33150c
with:
path: 'build'
- name: Deploy to GitHub pages
id: deployment
uses: actions/deploy-pages@9dbe3824824f8a1377b8e298bafde1a50ede43e5
- name: Slack notify on failure
if: failure()
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117
with:
payload: |
{
"text": "Deployment of Paas Tech Docs with commit ${{ github.sha }} FAILED."
}
env:
SLACK_WEBHOOK_URL: ${{secrets.SLACK_WEBHOOK_URL}}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK