Skip to content

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

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

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

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@52b8784594ec115fd17094752708121dc5dabb47
with:
bundler-cache: true
- name: Setup Python
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236
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