Skip to content

v3.59.4

v3.59.4 #452

name: Deploy frontends (public)
on:
release:
types: [published]
workflow_dispatch:
jobs:
deploy:
name: Deploy public
strategy:
matrix:
env: [demo, production]
environment: ${{ matrix.env }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: public/package-lock.json
- name: Install and Build 🔧
env:
DEPLOY_ENV: ${{ matrix.env }}
NEXT_PUBLIC_API_URL: ${{ vars.API_URL }}
NEXT_PUBLIC_CMS_URL: ${{ vars.CMS_URL }}
NEXT_PUBLIC_CMS_TOKEN: ${{ secrets.CMS_API_KEY }}
NEXT_PUBLIC_SEARCH_URL: ${{ vars.API_SEARCH_URL }}
NEXT_PUBLIC_SEARCH_TOKEN: ${{ secrets.MEILISEARCH_API_KEY }}
run: |
cd public
npm ci
NODE_OPTIONS=--openssl-legacy-provider npm run build
cp -R out/_next out/startup-etat/_next
- name: Deploy to bucket
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ vars.PUBLIC_BUCKET_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.BUCKET_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.BUCKET_SECRET_KEY }}
AWS_S3_ENDPOINT: ${{ vars.BUCKET_ENDPOINT }}
AWS_REGION: ${{ vars.BUCKET_REGION }}
SOURCE_DIR: public/out