Update dependency vue to v3.5.10 #871
This file contains 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: Pipeline | |
## preparation → sonarqube → deploy-production | |
## ↘ ↗ | |
## deploy-preview | |
env: | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
on: | |
push: | |
paths-ignore: | |
- 'LICENSE' | |
- 'README.md' | |
jobs: | |
preparation: | |
name: Preparation | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache Node Modules | |
uses: actions/cache@v4 | |
id: cache-node-module | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.OS }}-node-modules- | |
- name: Cache nuxt | |
uses: actions/cache@v4 | |
id: cache-nuxt | |
with: | |
path: .nuxt | |
key: ${{ runner.OS }}-nuxt-${{ hashFiles('**/nuxt.config.ts') }} | |
restore-keys: | | |
${{ runner.OS }}-nuxt- | |
- name: Install dependencies | |
if: steps.cache-node-module.outputs.cache-hit != 'true' | |
run: yarn install --frozen-lockfile | |
- name: Outdated listing | |
run: yarn outdated | |
continue-on-error: true | |
- name: Prepare Nuxt | |
run: yarn postinstall | |
- name: Check the source code | |
run: | | |
yarn lint | |
yarn typecheck | |
- name: Test the source code | |
run: yarn test:coverage | |
- name: Archive code coverage results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: CodeCoverageResult | |
path: coverage | |
- name: Generate the static app | |
run: yarn generate | |
deploy-preview: | |
name: Deploy preview website | |
needs: [preparation] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache Node Modules | |
uses: actions/cache@v4 | |
id: cache-node-module | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.OS }}-node-modules- | |
- name: Cache nuxt | |
uses: actions/cache@v4 | |
id: cache-nuxt | |
with: | |
path: .nuxt | |
key: ${{ runner.OS }}-nuxt-${{ hashFiles('**/nuxt.config.ts') }} | |
restore-keys: | | |
${{ runner.OS }}-nuxt- | |
- name: Install Vercel CLI | |
run: npm install --global vercel@latest | |
- name: Pull Vercel Environment Information | |
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Build Project Artifacts | |
run: vercel build --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Deploy Project Artifacts to Vercel | |
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} >> deployment-url.txt | |
- name: Archive code deployment URL | |
uses: actions/upload-artifact@v4 | |
with: | |
name: DeploymentURL | |
path: deployment-url.txt | |
sonarqube: | |
name: SonarQube | |
needs: [preparation] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache Node Modules | |
uses: actions/cache@v4 | |
id: cache-node-module | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.OS }}-node-modules- | |
- name: Cache nuxt | |
uses: actions/cache@v4 | |
id: cache-nuxt | |
with: | |
path: .nuxt | |
key: ${{ runner.OS }}-nuxt-${{ hashFiles('**/nuxt.config.ts') }} | |
restore-keys: | | |
${{ runner.OS }}-nuxt- | |
- name: Download code coverage results | |
uses: actions/download-artifact@v4 | |
with: | |
name: CodeCoverageResult | |
path: coverage | |
- name: Setup SonarQube | |
uses: warchant/setup-sonar-scanner@v8 | |
- name: Get version | |
id: version | |
shell: bash | |
run: | | |
echo "GIT_VERSION=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV | |
- name: Run SonarQube | |
env: | |
# to get access to secrets.SONAR_TOKEN, provide GITHUB_TOKEN | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: sonar-scanner | |
-Dsonar.token=${{ secrets.SONAR_TOKEN }} | |
-Dsonar.organization=fabiencrassat-github | |
-Dsonar.host.url=https://sonarcloud.io/ | |
-Dsonar.projectKey=cv-with-nuxt | |
-Dsonar.projectVersion=${{ env.GIT_VERSION }} | |
-Dsonar.qualitygate.wait=true | |
deploy-production: | |
name: Deploy production website | |
needs: [deploy-preview, sonarqube] | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache Node Modules | |
uses: actions/cache@v4 | |
id: cache-node-module | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-node-modules-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.OS }}-node-modules- | |
- name: Cache nuxt | |
uses: actions/cache@v4 | |
id: cache-nuxt | |
with: | |
path: .nuxt | |
key: ${{ runner.OS }}-nuxt-${{ hashFiles('**/nuxt.config.ts') }} | |
restore-keys: | | |
${{ runner.OS }}-nuxt- | |
- name: Install Vercel CLI | |
run: npm install --global vercel@latest | |
- name: Pull Vercel Environment Information | |
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Build Project Artifacts | |
run: vercel build --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Deploy Project Artifacts to Vercel | |
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} |