Skip to content

fix: add build step #34

fix: add build step

fix: add build step #34

Workflow file for this run

name: Docs deployment workflow
on:
push:
branches:
- develop
- fix/deployment_workflows
env:
CERTIFICATE_ARN: ${{ secrets.DOCS_SSL_CERTIFICATE_ARN }}
ENV: production
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.DOCS_SIWT_XYZ_DISTRIBUTION }}
jobs:
format-and-test:
runs-on: ubuntu-latest
environment: Production
permissions:
contents: 'read'
actions: 'read'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
- uses: nrwl/nx-set-shas@v3
with:
main-branch-name: 'develop'
workflow-id: 'deploy-docs.yml'
- run: npm ci
- name: Install docusaurus dependencies specifically
run: npm install --prefix ./packages/docs.siwt.xyz
- run: npx nx format:check --exclude=acq,core,discord,discord-bot-ui,discord-bot-ui-e2e,react,sdk,siwt.xyz,siwt.xyz-e2e,smart-contracts,oidc-client,oidc-bridge,ory-hydra
- run: npx nx build docs.siwt.xyz --skip-nx-cache
deploy:
runs-on: ubuntu-latest
needs: format-and-test
environment: Production
permissions:
contents: 'read'
actions: 'read'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
- uses: nrwl/nx-set-shas@v3
with:
main-branch-name: 'develop'
workflow-id: 'deploy-docs.yml'
- run: npm ci
- name: Install docusaurus dependencies specifically
run: npm install --prefix ./packages/docs.siwt.xyz
- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
aws-region: 'eu-central-1'
- run: |
touch .env
echo SSL_CERTIFICATE_ARN=$CERTIFICATE_ARN >> .env
echo ENV=$ENV >> .env
cat .env
- name: Build
run: npx nx build docs.siwt.xyz --skip-nx-cache
- name: Deploy
run: npx nx deploy docs.siwt.xyz --production --skip-nx-cache
- name: Invalidate Distribution
run: aws cloudfront create-invalidation --distribution-id=$CLOUDFRONT_DISTRIBUTION_ID --paths '/*'