Skip to content

Commit

Permalink
Deploy latest commit on github pages and github container registry
Browse files Browse the repository at this point in the history
Run tests first
Don't deploy releases to github pages (only to the ghcr)

Signed-off-by: pdamianik <[email protected]>
  • Loading branch information
pdamianik committed Feb 29, 2024
1 parent 9c65fa7 commit ee2f526
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
48 changes: 47 additions & 1 deletion .github/workflows/main-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}

deploy:
if: false
needs: build_site
runs-on: ubuntu-latest

Expand Down

0 comments on commit ee2f526

Please sign in to comment.