diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/deploy-prod.yml similarity index 59% rename from .github/workflows/build-and-deploy.yml rename to .github/workflows/deploy-prod.yml index 3d6c3ce..f7bc155 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/deploy-prod.yml @@ -1,11 +1,10 @@ -# Simple workflow for deploying static content to GitHub Pages -# Adapted from vite.dev -name: Deploy static content to Pages +name: deploy-prod +run-name: Deploy to Production on: - # Runs on pushes targeting the default branch push: - branches: ['main'] + tags: + - "v*" env: AWS_REGION: ${{ vars.AWS_DEFAULT_REGION }} @@ -17,30 +16,7 @@ permissions: id-token: write jobs: - deploy-staging: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up Bun - uses: oven-sh/setup-bun@v2 - - - name: Install - run: bun install - - - name: Build with Vite - run: bun run build --base=/cellpack-client - - - name: Deploy - uses: JamesIves/github-pages-deploy-action@v4 - with: - folder: ./dist - clean-exclude: pr-preview/ - branch: gh-pages - deploy-prod: - if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml new file mode 100644 index 0000000..1f3011f --- /dev/null +++ b/.github/workflows/deploy-staging.yml @@ -0,0 +1,36 @@ +# Simple workflow for deploying static content to GitHub Pages +# Adapted from vite.dev +name: Deploy static content to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ['main'] + +permissions: + contents: write + pages: write + id-token: write + +jobs: + deploy-staging: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Bun + uses: oven-sh/setup-bun@v2 + + - name: Install + run: bun install + + - name: Build with Vite + run: bun run build --base=/cellpack-client + + - name: Deploy + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: ./dist + clean-exclude: pr-preview/ + branch: gh-pages