feat: connect all list pages to api lieux inclusion numerique #13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Build and deploy | |
on: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
deploy: | |
name: Build and Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v5 | |
- name: Install app dependencies | |
uses: pnpm/action-setup@v4 | |
with: | |
version: latest | |
- name: Install infrastructure dependencies | |
run: pnpm install --frozen-lockfile | |
working-directory: infrastructure | |
- name: Set up Node.js | |
uses: actions/setup-node@v5 | |
with: | |
node-version: latest | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Build cache | |
uses: actions/cache@v4 | |
with: | |
path: .next/cache | |
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} | |
restore-keys: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}- | |
- name: 'Create env file' | |
run: | | |
touch .env | |
echo HOSTNAME="${{ vars.HOSTNAME }}" >> .env | |
echo NEXT_PUBLIC_APP_NAME="${{ vars.NEXT_PUBLIC_APP_NAME }}" >> .env | |
echo NEXT_ASSET_PREFIX="${{ vars.NEXT_ASSET_PREFIX }}" >> .env | |
echo NEXT_PUBLIC_BASE_PATH="${{ vars.NEXT_PUBLIC_BASE_PATH }}" >> .env | |
echo INCLUSION_NUMERIQUE_API_TOKEN="${{ secrets.INCLUSION_NUMERIQUE_API_TOKEN }}" >> .env | |
- name: Build | |
run: pnpm build | |
- name: Deploy infrastructure | |
uses: pulumi/actions@v6 | |
with: | |
command: up | |
stack-name: marc-gavanier/cartographie/prod | |
work-dir: infrastructure | |
env: | |
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | |
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }} | |
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }} | |
SCW_DEFAULT_PROJECT_ID: ${{ secrets.SCW_DEFAULT_PROJECT_ID }} | |
TAGS: ${{ vars.TAGS }} | |
- name: Remove previous static files | |
run: aws --endpoint-url https://s3.fr-par.scw.cloud s3 rm s3://cartographie-prod-app-static-bucket --recursive | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.SCW_ACCESS_KEY }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.SCW_SECRET_KEY }} | |
AWS_DEFAULT_REGION: fr-par | |
- name: Upload static files | |
run: aws --endpoint-url https://s3.fr-par.scw.cloud s3 sync .next/static s3://cartographie-prod-app-static-bucket/_next/static --acl public-read | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.SCW_ACCESS_KEY }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.SCW_SECRET_KEY }} | |
AWS_DEFAULT_REGION: fr-par |