diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca4d8c0d..a791897e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,6 @@ name: CI on: - push: - branches: - - main pull_request: permissions: @@ -18,7 +15,8 @@ jobs: with: fetch-depth: 0 - - uses: pnpm/action-setup@v4 + - name: Checkout repository + uses: pnpm/action-setup@v4 with: version: 9.12.1 @@ -27,13 +25,15 @@ jobs: # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun - run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" + - name: Install Node # Cache node_modules - - uses: actions/setup-node@v4 + uses: actions/setup-node@v4 with: node-version: 20 cache: 'pnpm' - - run: pnpm install --frozen-lockfile + - name: Install dependencies + run: pnpm install --frozen-lockfile - uses: nrwl/nx-set-shas@v4 # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..04267476 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,44 @@ +name: Deploy + +on: + push: + branches: + - main + +jobs: + main: + name: Deploy + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write # needed for provenance data generation + timeout-minutes: 10 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Checkout repository + uses: pnpm/action-setup@v4 + with: + version: 9.12.1 + + - name: Install Node + # Cache node_modules + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - uses: nrwl/nx-set-shas@v4 + - run: pnpm exec nx build devmx + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist/apps/devmx/browser