From 234bebfac4c45bd1ce9733c80e25adfcdcab4e25 Mon Sep 17 00:00:00 2001 From: Caleb Hearon Date: Sun, 28 Apr 2024 15:16:09 -0400 Subject: [PATCH] workflow revamp [temp] --- .github/workflows/build-test.yml | 29 +------------------------ .github/workflows/deploy.yml | 31 +++++++++++++++++++++++++++ .github/workflows/on_pull_request.yml | 5 +++++ .github/workflows/on_push.yml | 8 +++++++ .github/workflows/on_tag.yml | 10 +++++++++ 5 files changed, 55 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/on_pull_request.yml create mode 100644 .github/workflows/on_push.yml create mode 100644 .github/workflows/on_tag.yml diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index fc64da1..f6ab9cf 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -1,5 +1,5 @@ name: Build and test -on: push +on: workflow_call jobs: node: runs-on: ubuntu-latest @@ -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 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..5c462cb --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,31 @@ +name: Deploy +on: workflow_call +jobs: + deploy: + uses: ./.github/workflows/test.yml + 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 diff --git a/.github/workflows/on_pull_request.yml b/.github/workflows/on_pull_request.yml new file mode 100644 index 0000000..ab15180 --- /dev/null +++ b/.github/workflows/on_pull_request.yml @@ -0,0 +1,5 @@ +name: Pull Request Created +on: pull_request +jobs: + build-test: + uses: ./.github/workflows/build-test.yml diff --git a/.github/workflows/on_push.yml b/.github/workflows/on_push.yml new file mode 100644 index 0000000..44b60b9 --- /dev/null +++ b/.github/workflows/on_push.yml @@ -0,0 +1,8 @@ +name: Pushed +on: + push: + branches: + - '**' +jobs: + build-test: + uses: ./.github/workflows/build-test.yml diff --git a/.github/workflows/on_tag.yml b/.github/workflows/on_tag.yml new file mode 100644 index 0000000..a773919 --- /dev/null +++ b/.github/workflows/on_tag.yml @@ -0,0 +1,10 @@ +name: Tag Created +on: + push: + tags: + - '**' +jobs: + build-test: + uses: ./.github/workflows/build-test.yml + deploy: + uses: ./.github/workflows/deploy.yml