chore(deps): upgrade vite to v5.4.20 [SECURITY] (#1275) #522
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: Deploy | |
| on: | |
| push: | |
| branches: ['main', 'dev', 'feature/**'] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| version: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| package_version: ${{ steps.version.outputs.package_version }} | |
| steps: | |
| # SETUP | |
| - if: ${{ github.ref_name == 'main' }} | |
| uses: actions/checkout@v5 | |
| - if: ${{ github.ref_name == 'main' }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'yarn' | |
| - if: ${{ github.ref_name == 'main' }} | |
| run: yarn --immutable | |
| - if: ${{ github.ref_name == 'main' }} | |
| id: version | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| echo "package_version=$(yarn semantic-release -d | sed -n 's/.*next release version is \([0-9]\+\.[0-9]\+\.[0-9]\+\)/\1/p')" >> "$GITHUB_OUTPUT" | |
| - if: ${{ github.ref_name == 'main' }} | |
| run: | | |
| [ ! -z "${{ steps.version.outputs.package_version }}" ] || exit 1 | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: version | |
| steps: | |
| - uses: actions/checkout@v5 | |
| # Getting dependencies before the build to speed up the ARM build | |
| # This a bit of a workaround, but it shouldn't be a problem, as yarn loads the dependencies in all formats needed | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'yarn' | |
| - run: | | |
| yarn config set nodeLinker pnp | |
| yarn --immutable | |
| yarn config set nodeLinker node-modules | |
| rm -rf .yarn/unplugged .pnp.cjs .pnp.loader.mjs | |
| - uses: docker/setup-qemu-action@v3 | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: docker/login-action@v3 | |
| with: | |
| username: mauricenino | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - uses: docker/metadata-action@v5 | |
| id: meta | |
| with: | |
| images: | | |
| ghcr.io/mauricenino/dashdot | |
| mauricenino/dashdot | |
| labels: | | |
| org.opencontainers.image.title="dash." | |
| org.opencontainers.image.description="dash. - a modern server dashboard" | |
| org.opencontainers.image.authors="MauriceNino <[email protected]>" | |
| org.opencontainers.image.url=https://github.com/MauriceNino/dashdot | |
| org.opencontainers.image.source=https://github.com/MauriceNino/dashdot | |
| org.opencontainers.image.licenses=MIT | |
| tags: | | |
| type=semver,pattern={{version}},value=${{ format('v{0}', needs.version.outputs.package_version) }},enable=${{ github.ref_name == 'main' }} | |
| type=semver,pattern={{major}}.{{minor}},value=${{ format('v{0}', needs.version.outputs.package_version) }},enable=${{ github.ref_name == 'main' }} | |
| type=semver,pattern={{major}},value=${{ format('v{0}', needs.version.outputs.package_version) }},enable=${{ github.ref_name == 'main' }} | |
| type=ref,event=branch,enable=${{ github.ref_name != 'main' }} | |
| - uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64/v8 | |
| target: prod | |
| push: true | |
| build-args: | | |
| VERSION=${{ github.ref_name == 'main' && needs.version.outputs.package_version || format('0.0.0-{0}', github.ref_name) }} | |
| BUILDHASH=${{ github.sha }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| build_nvidia: | |
| runs-on: ubuntu-latest | |
| needs: version | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'yarn' | |
| - run: | | |
| yarn config set nodeLinker pnp | |
| yarn --immutable | |
| yarn config set nodeLinker node-modules | |
| rm -rf .yarn/unplugged .pnp.cjs .pnp.loader.mjs | |
| - uses: docker/setup-qemu-action@v3 | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: docker/login-action@v3 | |
| with: | |
| username: mauricenino | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - uses: docker/metadata-action@v5 | |
| id: meta_nvidia | |
| with: | |
| flavor: | | |
| latest=false | |
| images: | | |
| ghcr.io/mauricenino/dashdot | |
| mauricenino/dashdot | |
| labels: | | |
| org.opencontainers.image.title="dash." | |
| org.opencontainers.image.description="dash. - a modern server dashboard" | |
| org.opencontainers.image.authors="MauriceNino <[email protected]>" | |
| org.opencontainers.image.url=https://github.com/MauriceNino/dashdot | |
| org.opencontainers.image.source=https://github.com/MauriceNino/dashdot | |
| org.opencontainers.image.licenses=MIT | |
| tags: | | |
| type=semver,pattern={{version}},value=${{ format('v{0}', needs.version.outputs.package_version) }},enable=${{ github.ref_name == 'main' }},prefix=nvidia- | |
| type=semver,pattern={{major}}.{{minor}},value=${{ format('v{0}', needs.version.outputs.package_version) }},enable=${{ github.ref_name == 'main' }},prefix=nvidia- | |
| type=semver,pattern={{major}},value=${{ format('v{0}', needs.version.outputs.package_version) }},enable=${{ github.ref_name == 'main' }},prefix=nvidia- | |
| type=ref,event=branch,enable=${{ github.ref_name != 'main' }},prefix=nvidia- | |
| type=raw,value=nvidia,enable=${{ github.ref_name == 'main' }} | |
| - uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: Dockerfile.nvidia | |
| platforms: linux/amd64,linux/arm64/v8 | |
| target: prod | |
| push: true | |
| build-args: | | |
| VERSION=${{ github.ref_name == 'main' && needs.version.outputs.package_version || format('0.0.0-{0}', github.ref_name) }} | |
| BUILDHASH=${{ github.sha }} | |
| labels: ${{ steps.meta_nvidia.outputs.labels }} | |
| tags: ${{ steps.meta_nvidia.outputs.tags }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| # Run semantic release | |
| semantic_release: | |
| if: ${{ github.ref_name == 'main' }} | |
| runs-on: ubuntu-latest | |
| needs: [build, build_nvidia] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'yarn' | |
| - run: yarn --immutable | |
| - env: | |
| GIT_USER: github-actions | |
| GIT_AUTHOR_NAME: github-actions | |
| GIT_COMMITTER_NAME: github-actions | |
| GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com | |
| GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com | |
| GIT_PASS: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| yarn semantic-release | |
| # Update docs | |
| update_docs: | |
| if: ${{ github.ref_name == 'main' }} | |
| runs-on: ubuntu-latest | |
| needs: [build, build_nvidia] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'yarn' | |
| - run: yarn --immutable | |
| - env: | |
| GIT_USER: github-actions | |
| GIT_AUTHOR_NAME: github-actions | |
| GIT_COMMITTER_NAME: github-actions | |
| GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com | |
| GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com | |
| GIT_PASS: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| yarn nx build docs | |
| yarn nx deploy docs | |
| # Update deployment on rex | |
| rex: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - if: ${{ github.ref_name == 'main' }} | |
| run: curl --get --data-urlencode "service=dashdot" --data-urlencode "image=mauricenino/dashdot:latest" --data-urlencode "secret=${{ secrets.REX_TOKEN }}" https://rex.mauz.dev/deploy | |
| - if: ${{ github.ref_name == 'dev' }} | |
| run: curl --get --data-urlencode "service=dashdot" --data-urlencode "image=mauricenino/dashdot:dev" --data-urlencode "secret=${{ secrets.REX_TOKEN }}" https://rex.mauz.dev/deploy |