Skip to content

Generate Docs and deploy #94

Generate Docs and deploy

Generate Docs and deploy #94

name: Generate Docs and deploy
on:
workflow_run:
workflows: ["Run Tests"]
branches: [main]
types:
- completed
jobs:
docs:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: "0" # fetch all history for all tags and branches so that changeset-builder can generate changelogs
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
scope: "@differentialhq"
- name: Install dependencies on root
run: npm install
- name: Configure Git User
run: |
git config --global user.name "Differential CI"
git config --global user.email "ci@differential.dev"
- name: Generate docs
run: |
make docs
git add .
git commit -m "chore: Update documentation [skip ci]" || true # ignore if there's nothing to commit
git push origin main
- uses: retypeapp/action-build@latest
with:
config: docs
- uses: retypeapp/action-github-pages@latest
with:
update-branch: true
deploy:
name: deploy
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v3
- uses: sliteteam/github-action-git-crypt-unlock@1.2.0
env:
GIT_CRYPT_KEY: ${{ secrets.GIT_CRYPT_KEY }}
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: cd control-plane && flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}