chore(deps): update vuepress monorepo #8535
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
quality: | |
name: Quality | |
if: "!contains(github.event.head_commit.message, 'chore(release):')" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14.x, 16.x, 17.x] | |
env: | |
CPV_CONFLUENCE_API_TOKEN: ${{ secrets.CPV_CONFLUENCE_API_TOKEN }} | |
CPV_CONFLUENCE_API_USERNAME: ${{ secrets.CPV_CONFLUENCE_API_USERNAME }} | |
CPV_CONFLUENCE_BASE_URL: ${{ secrets.CPV_CONFLUENCE_BASE_URL }} | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
CPV_JIRA_READER_API_USERNAME: ${{ secrets.CPV_JIRA_READER_API_USERNAME }} | |
CPV_JIRA_READER_API_TOKEN: ${{ secrets.CPV_JIRA_READER_API_TOKEN }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ matrix.node-version }}-npm-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node-${{ matrix.node-version }}-npm- | |
- name: Install dependencies | |
run: npm ci | |
- name: Lint | |
run: npm run lint | |
- name: Tests | |
run: npm test | |
- name: Prod build | |
run: npm run build | |
- name: Install Vercel CLI | |
if: ${{ matrix.node-version == '16.x' }} | |
run: npm install --global vercel@latest | |
- name: Pull Vercel Environment Information | |
if: ${{ matrix.node-version == '16.x' }} | |
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Build Project Artifacts | |
if: ${{ matrix.node-version == '16.x' }} | |
run: vercel build --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Deploy Project Artifacts to Vercel | |
if: ${{ matrix.node-version == '16.x' }} | |
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Run Cypress Tests | |
uses: cypress-io/github-action@v2 | |
if: ${{ steps.vercel-deploy.outputs.DEPLOYMENT_CREATED }} | |
with: | |
browser: chrome | |
env: | |
CYPRESS_BASE_URL: ${{ steps.vercel-deploy.outputs.PREVIEW_URL }}/cpv | |
- name: Upload Cypress Screenshots | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: cypress-screenshots-artifacts | |
retention-days: 5 | |
path: ${{ github.repository }}/tests/e2e/cypress/screenshots/ | |
- name: Upload Cypress Videos | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: cypress-videos-artifacts | |
retention-days: 1 | |
path: ${{ github.repository }}/tests/e2e/cypress/videos/ | |
release: | |
name: Release | |
# needs: quality | |
# https://github.community/t/how-do-i-specify-job-dependency-running-in-another-workflow/16482 | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'chore(release):') | |
runs-on: ubuntu-latest | |
env: | |
CACHE_IMAGE: sanofiiadc/konviw | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16.x" | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install dependencies | |
run: npm ci | |
- name: Install semantic-release | |
run: npm install -g semantic-release@19.0.5 @semantic-release/github @semantic-release/git@10.0.1 @semantic-release/changelog@6.0.1 @semantic-release/exec@6.0.3 | |
# - name: Log into Docker registry | |
# uses: azure/docker-login@v1 | |
# with: | |
# username: ${{ secrets.SANOFI_DOCKER_HUB_USERNAME }} | |
# password: ${{ secrets.SANOFI_DOCKER_HUB_TOKEN }} | |
# - name: Pull Docker cache image | |
# run: docker pull --quiet ${CACHE_IMAGE} 2>/dev/null || true | |
- name: Semantic Release | |
env: | |
# MDF_BRANCH_TAG: latest | |
# MDF_BUILD_PARAMS: --cache-from ${{ env.CACHE_IMAGE }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: npx semantic-release |