From ee2f52664e1092ebcdf885e82c75de6f370525df Mon Sep 17 00:00:00 2001 From: pdamianik <39028343+pdamianik@users.noreply.github.com> Date: Thu, 29 Feb 2024 23:44:46 +0100 Subject: [PATCH] Deploy latest commit on github pages and github container registry Run tests first Don't deploy releases to github pages (only to the ghcr) Signed-off-by: pdamianik <39028343+pdamianik@users.noreply.github.com> --- .github/workflows/main-publish.yml | 48 ++++++++++++++++++++++++++- .github/workflows/release-publish.yml | 1 + 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main-publish.yml b/.github/workflows/main-publish.yml index bc7aa75..3d011fe 100644 --- a/.github/workflows/main-publish.yml +++ b/.github/workflows/main-publish.yml @@ -11,9 +11,38 @@ env: IMAGE_NAME: ${{ github.repository }} jobs: + run_tests: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v3 + with: + version: 8 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: pnpm + + - name: Install dependencies + run: pnpm install + + - name: Run unit tests + run: pnpm test:unit + + - name: Install playwright browsers + run: pnpm exec playwright install --with-deps + + - name: Run integration tests + run: pnpm test:integration + build_site: + needs: run_tests runs-on: ubuntu-latest - if: false steps: - name: Checkout uses: actions/checkout@v4 @@ -46,6 +75,23 @@ jobs: # this should match the `pages` option in your adapter-static options path: 'build/' + deploy: + needs: build_site + runs-on: ubuntu-latest + + permissions: + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - name: Deploy + id: deployment + uses: actions/deploy-pages@v4 + docker: needs: build_site runs-on: ubuntu-latest diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml index 860ca5d..ed11180 100644 --- a/.github/workflows/release-publish.yml +++ b/.github/workflows/release-publish.yml @@ -120,6 +120,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} deploy: + if: false needs: build_site runs-on: ubuntu-latest