ci: use available aws cli from github hosted virtual environments #66
Workflow file for this run
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: Validate feature branch | |
on: | |
push: | |
branches: | |
- 'build/*' | |
- 'chore/*' | |
- 'ci/*' | |
- 'docs/*' | |
- 'feat/*' | |
- 'fix/*' | |
- 'perf/*' | |
- 'refactor/*' | |
- 'revert/*' | |
- 'style/*' | |
- 'test/*' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
code-check: | |
name: Code check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: latest | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: latest | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Biome | |
run: pnpm biome:ci --reporter=github | |
commit-check: | |
name: Commit check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: latest | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: latest | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: CommitLint | |
run: pnpm lint:commit | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: latest | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: latest | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Test | |
run: pnpm test | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: latest | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: latest | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- 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 | |
- name: Build | |
run: pnpm build | |
- name: Prepare build artifact | |
run: mv .next _next | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Next build | |
path: _next/ | |
deploy-preview: | |
name: Deploy Preview | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: latest | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: latest | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
working-directory: infrastructure | |
- name: Download build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: Next build | |
path: .next/ | |
- name: Preview infrastructure deployment | |
uses: pulumi/actions@v6 | |
with: | |
command: preview | |
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 }} | |