Skip to content

Commit

Permalink
build/test on pull_request and deploy on tags
Browse files Browse the repository at this point in the history
  • Loading branch information
chearon committed Apr 28, 2024
1 parent 3db37f9 commit 75b1b57
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 28 deletions.
29 changes: 1 addition & 28 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Build and test
on: push
on: workflow_call
jobs:
node:
runs-on: ubuntu-latest
Expand All @@ -24,30 +24,3 @@ jobs:
- run: bun install --frozen-lockfile
- run: bun run build
- run: bun run test
deploy:
needs: bun
permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Bun v1
uses: oven-sh/setup-bun@v1
with:
bun-version: 1
- run: bun install --frozen-lockfile
- run: bun run build
- run: bun run vite build --minify false --base dropflow/
- name: Upload site
uses: actions/upload-pages-artifact@v3
with:
name: github-pages
path: dist/site/
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
29 changes: 29 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy
on: workflow_call
jobs:
deploy:
permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Bun v1
uses: oven-sh/setup-bun@v1
with:
bun-version: 1
- run: bun install --frozen-lockfile
- run: bun run build
- run: bun run vite build --minify false --base dropflow/
- name: Upload site
uses: actions/upload-pages-artifact@v3
with:
name: github-pages
path: dist/site/
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
5 changes: 5 additions & 0 deletions .github/workflows/on_pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: Pull Request Created
on: pull_request
jobs:
build-test:
uses: ./.github/workflows/build-test.yml
8 changes: 8 additions & 0 deletions .github/workflows/on_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Pushed
on:
push:
branches:
- '**'
jobs:
build-test:
uses: ./.github/workflows/build-test.yml
11 changes: 11 additions & 0 deletions .github/workflows/on_tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Tag Created
on:
push:
tags:
- '**'
jobs:
build-test:
uses: ./.github/workflows/build-test.yml
deploy:
needs: build-test
uses: ./.github/workflows/deploy.yml

0 comments on commit 75b1b57

Please sign in to comment.