fx(sonar): javascript:S7772: Use node: prefix for built-in module import #1588
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 main | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| # Allow one concurrent deployment | |
| concurrency: | |
| group: 'deploy-main' | |
| cancel-in-progress: true | |
| jobs: | |
| build-distribution: | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 'π°οΈ Checkout source code' | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: 'π°οΈ Setup Node' | |
| uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 | |
| with: | |
| node-version: '24.x' | |
| registry-url: 'https://registry.npmjs.org' | |
| scope: '@kaoto' | |
| cache: 'yarn' | |
| # Install dependencies | |
| - name: π§ Install dependencies | |
| run: yarn install --immutable --mode=skip-build | |
| # Build packages | |
| - name: 'π§ Build packages' | |
| run: | | |
| yarn workspaces foreach --verbose --all --topological-dev run build | |
| - name: 'π§ Tar UI Dist' | |
| shell: bash | |
| run: | | |
| tar -czf ${{ runner.temp }}/kaoto-ui.tgz -C packages/ui/dist . | |
| ls -lh ${{ runner.temp }}/kaoto-ui.tgz | |
| - name: 'π§ Persist UI Dist' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: 'kaoto-ui-${{ github.run_id }}' | |
| path: '${{ runner.temp }}/kaoto-ui.tgz' | |
| retention-days: 1 | |
| deploy-pages: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build-distribution | |
| steps: | |
| - name: 'π°οΈ Checkout source code' | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: 'π°οΈ Setup Pages' | |
| uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0 | |
| - name: 'π°οΈ Download UI Dist' | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: kaoto-ui-${{ github.run_id }} | |
| path: '${{ runner.temp }}' | |
| - name: 'π°οΈ Extract UI Dist' | |
| shell: bash | |
| run: | | |
| mkdir -p packages/ui/dist | |
| tar -xzf "${{ runner.temp }}/kaoto-ui.tgz" -C packages/ui/dist | |
| - name: 'π€ Upload artifact @kaoto/kaoto web application' | |
| uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 | |
| with: | |
| path: 'packages/ui/dist' | |
| - name: 'π Deploy to GitHub Pages' | |
| id: deployment | |
| uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v3.0.2-node.24 - it is the same as v5 | |
| deploy-images: | |
| if: github.repository == 'KaotoIO/kaoto' | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build-distribution | |
| steps: | |
| - name: 'π°οΈ Checkout source code' | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: 'π°οΈ Download UI Dist' | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: kaoto-ui-${{ github.run_id }} | |
| path: '${{ runner.temp }}' | |
| - name: 'π°οΈ Extract UI Dist' | |
| shell: bash | |
| run: | | |
| mkdir -p packages/ui/dist | |
| tar -xzf "${{ runner.temp }}/kaoto-ui.tgz" -C packages/ui/dist | |
| - name: 'π°οΈ Login to Container Registry' | |
| uses: docker/login-action@371161bbe7024a29a25c5e19bfcbc0804fe9ad2c # v4.5.2 | |
| with: | |
| registry: quay.io | |
| username: ${{ secrets.QUAY_USERNAME }} | |
| password: ${{ secrets.QUAY_PASSWORD }} | |
| - name: 'π§ Build Container Image' | |
| shell: bash | |
| # TODO: the container image name should be configurable via vars/secrets | |
| run: | | |
| docker build -t "quay.io/kaotoio/kaoto-app:main" . | |
| - name: 'π€ Upload Container Image' | |
| shell: bash | |
| run: | | |
| docker push quay.io/kaotoio/kaoto-app:main |