From b988edb87b3a6cedb5c69a7ba6f1ea6a89bce6f1 Mon Sep 17 00:00:00 2001 From: guizmo Date: Thu, 25 Apr 2024 21:27:37 +0200 Subject: [PATCH] Add deploy job --- .github/workflows/deploy.yml | 17 --------------- .github/workflows/test.yml | 40 ++++++++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 19 deletions(-) delete mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index f259b48..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: test - -on: - push: - branches: - - 'main' - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: oven-sh/setup-bun@v1 - with: - bun-version: latest - - run: bun install - - run: bun run deploy \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 250def8..bd94a1f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,5 +11,41 @@ jobs: - uses: oven-sh/setup-bun@v1 with: bun-version: latest - - run: bun install - - run: bun run test \ No newline at end of file + - name: Install dependencies + run: bun install + - name: Run tests + run: bun run test + + build: + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + needs: test + steps: + - name: Build web app + run: bun run expo export -p web + - name: Setup Pages + if: github.ref == 'refs/heads/main' + uses: actions/configure-pages@v3 + - name: Upload Artifact + if: github.ref == 'refs/heads/main' + uses: actions/upload-pages-artifact@v1 + with: + path: "./dist" + + deploy: + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + needs: build + + permissions: + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2