Skip to content

Delivery to production #25

Delivery to production

Delivery to production #25

Workflow file for this run

name: Delivery to production
on:
push:
branches: [ main ]
paths:
- '.github/workflows/cd.prod.yml'
- 'public/**/*'
- 'stories/**/*'
- '.npmrc'
- '**.css'
- '**.jsx?'
- '**.tsx?'
- '*.json'
- '!tools/**/*'
schedule:
- cron: 0 7 1 * * # at 07:00 on day-of-month 1, UTC
workflow_dispatch:
inputs:
reason:
description: The reason for dispatching it manually.
type: string
default: manual healthcheck
required: true
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
name: Building
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
with: { fetch-depth: 0 }
- name: Set up Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
cache-dependency-path: package-lock.json
check-latest: true
- name: Install dependencies
run: ./Taskfile npm ci
env:
FONTAWESOME_TOKEN: ${{ secrets.FONTAWESOME_TOKEN }}
- name: Set up GitHub Pages
uses: actions/configure-pages@v3
- name: Build static HTML with Storybook
run: npm run build
- name: Upload the documentation
uses: actions/upload-pages-artifact@v2
with: { path: storybook-static }
deploy:
name: Deploying
needs: [ build ]
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
contents: read
id-token: write
pages: write
steps:
- name: Deploy it to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
notify:
name: Notifying
needs: [ build, deploy ]
runs-on: ubuntu-latest
if: failure() || success()
steps:
- name: Checkout the repository
uses: actions/checkout@v3
with: { fetch-depth: 0 }
- name: Send notification
uses: ./.github/actions/notify
continue-on-error: true
with:
emoji: 🎁
channel: ${{ secrets.SLACK_WEBHOOK }}
success: ${{ ! contains(needs.*.result, 'failure') }}