diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index b684d4a710..a5dcef04d1 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -15,40 +15,6 @@ concurrency: cancel-in-progress: true jobs: - cache-and-install: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: 20 - - - name: Use pnpm - uses: pnpm/action-setup@v2 - with: - version: 8 - run_install: false - - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - - name: Setup pnpm cache - uses: actions/cache@v3 - with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - - name: Install dependencies - run: pnpm install --frozen-lockfile - filter-actions: runs-on: ubuntu-latest permissions: @@ -73,9 +39,8 @@ jobs: - 'packages/**' - dialtone: - needs: [cache-and-install, filter-actions] - if: ${{ needs.filter-actions.outputs.dialtone == 'true' }} + deploy: + needs: filter-actions runs-on: ubuntu-latest permissions: contents: read @@ -83,6 +48,8 @@ jobs: pull-requests: write env: VUEPRESS_BASE_URL: /deploy-previews/pr-${{github.event.pull_request.number}}/ + DIALTONE_BUCKET_DIRECTORY: dialtone.dialpad.com/deploy-previews/pr-${{ github.event.pull_request.number }}/ + DIALTONE_VUE_3_BUCKET_DIRECTORY: dialtone.dialpad.com/vue3/deploy-previews/pr-${{ github.event.pull_request.number }}/ steps: - uses: actions/checkout@v4 with: @@ -116,8 +83,13 @@ jobs: run: pnpm install --frozen-lockfile - name: Build Dialtone library and documentation site + if: ${{ needs.filter-actions.outputs.dialtone == 'true' }} run: pnpm nx run --verbose dialtone-documentation:build + - name: Build Dialtone-vue 3 library and documentation site + if: ${{ needs.filter-actions.outputs.dialtone-vue-3 == 'true' }} + run: pnpm nx run --verbose dialtone-vue3-documentation:build + - id: auth name: Authenticate to Google Cloud uses: google-github-actions/auth@v1 @@ -128,18 +100,26 @@ jobs: - name: Set up Cloud SDK uses: google-github-actions/setup-gcloud@v1 - - name: Clean up bucket ${{ env.VUEPRESS_BASE_URL }} directory + - name: Clean up bucket Dialtone + if: ${{ needs.filter-actions.outputs.dialtone == 'true' }} + continue-on-error: true + run: gcloud storage rm --recursive ${{ format('gs://{0}', env.DIALTONE_BUCKET_DIRECTORY) }} + + - name: Clean up bucket Dialtone Vue 3 + if: ${{ needs.filter-actions.outputs.dialtone-vue-3 == 'true' }} continue-on-error: true - run: gcloud storage rm --recursive ${{ format('gs://dialtone.dialpad.com{0}', env.VUEPRESS_BASE_URL) }} + run: gcloud storage rm --recursive ${{ format('gs://{0}', env.DIALTONE_VUE_3_BUCKET_DIRECTORY) }} - name: Upload Dialtone to GCP + if: ${{ needs.filter-actions.outputs.dialtone == 'true' }} uses: google-github-actions/upload-cloud-storage@v1 with: path: apps/dialtone-documentation/docs/.vuepress/dist - destination: ${{ format('dialtone.dialpad.com{0}', env.VUEPRESS_BASE_URL) }} + destination: ${{ env.DIALTONE_BUCKET_DIRECTORY }} parent: false - - name: Add Message + - name: Add Dialtone ready message + if: ${{ needs.filter-actions.outputs.dialtone == 'true' }} uses: mshick/add-pr-comment@v1 env: BUILD_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} @@ -147,75 +127,19 @@ jobs: with: message: | ✔️ Dialtone Deploy Preview ready! - 😎 Browse the preview: https://dialtone.dialpad.com/deploy-previews/pr-${{ github.event.pull_request.number }} + 😎 Browse the preview: https://${{ env.DIALTONE_BUCKET_DIRECTORY }} allow-repeats: true - dialtone-vue-3: - needs: [cache-and-install, filter-actions] - if: ${{ needs.filter-actions.outputs.dialtone-vue-3 == 'true' }} - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - pull-requests: write - env: - BASE_DIRECTORY: /vue3/deploy-previews/pr-${{github.event.pull_request.number}}/ - steps: - - uses: actions/checkout@v4 - with: - ref: "refs/pull/${{ github.event.pull_request.number }}/merge" - - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: 20 - - - name: Use pnpm - uses: pnpm/action-setup@v2 - with: - version: 8 - run_install: false - - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - - name: Setup pnpm cache - uses: actions/cache@v3 - with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Build Dialtone library and documentation site - run: pnpm nx run --verbose dialtone-vue3-documentation:build - - - id: auth - name: Authenticate to Google Cloud - uses: google-github-actions/auth@v1 - with: - workload_identity_provider: ${{ secrets.DIALTONE_GCP_WIP }} - service_account: ${{ secrets.DIALTONE_GCP_SA }} - - - name: Set up Cloud SDK - uses: google-github-actions/setup-gcloud@v1 - - - name: Clean up bucket ${{ env.BASE_DIRECTORY }} directory - continue-on-error: true - run: gcloud storage rm --recursive ${{ format('gs://dialtone.dialpad.com{0}', env.BASE_DIRECTORY) }} - name: Upload Dialtone-vue 3 to GCP + if: ${{ needs.filter-actions.outputs.dialtone-vue-3 == 'true' }} uses: google-github-actions/upload-cloud-storage@v1 with: path: apps/dialtone-vue3-documentation/storybook-static - destination: ${{ format('dialtone.dialpad.com{0}', env.BASE_DIRECTORY) }} + destination: ${{ env.DIALTONE_VUE_3_BUCKET_DIRECTORY }} parent: false - - name: Add Message + - name: Add Dialtone Vue 3 ready message + if: ${{ needs.filter-actions.outputs.dialtone-vue-3 == 'true' }} uses: mshick/add-pr-comment@v1 env: BUILD_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} @@ -223,5 +147,5 @@ jobs: with: message: | ✔️ Dialtone-vue 3 Deploy Preview ready! - 😎 Browse the preview: https://dialtone.dialpad.com/vue3/deploy-previews/pr-${{ github.event.pull_request.number }} + 😎 Browse the preview: https://${{ env.DIALTONE_VUE_3_BUCKET_DIRECTORY }} allow-repeats: true diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6af70c65cb..c452df11fa 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -99,7 +99,6 @@ jobs: deploy-dialtone: needs: [cache-and-install, check-dialpad-member, get-branch-name, filter-actions] - if: ${{ needs.filter-actions.outputs.dialtone == 'true' }} runs-on: ubuntu-latest permissions: contents: 'read' @@ -180,7 +179,6 @@ jobs: deploy-dialtone-vue-3: needs: [cache-and-install, check-dialpad-member, get-branch-name, filter-actions] - if: ${{ needs.filter-actions.outputs.dialtone-vue-3 == 'true' }} runs-on: ubuntu-latest permissions: contents: 'read' diff --git a/apps/dialtone-vue3-documentation/.eslintrc.cjs b/apps/dialtone-vue3-documentation/.eslintrc.cjs index f161f5be36..ef15dabe10 100644 --- a/apps/dialtone-vue3-documentation/.eslintrc.cjs +++ b/apps/dialtone-vue3-documentation/.eslintrc.cjs @@ -26,6 +26,9 @@ module.exports = { 'max-len': ['error', { code: 120, tabWidth: 2, + ignoreComments: true, + ignoreStrings: true, + ignoreTemplateLiterals: true, }], 'prefer-promise-reject-errors': ['error', { allowEmptyReject: true,