diff --git a/.github/workflows/extension.yml b/.github/workflows/extension.yml index 452e3be..ea0b8ce 100644 --- a/.github/workflows/extension.yml +++ b/.github/workflows/extension.yml @@ -13,11 +13,6 @@ on: permissions: contents: write -env: - VITE_API_URL: ${{ secrets.API_URL }} - VITE_FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }} - VITE_WEB_URL: ${{ secrets.WEB_URL }} - jobs: setup: runs-on: ubuntu-latest @@ -85,9 +80,51 @@ jobs: run: pnpm run test working-directory: extension - build: + build-dev: + environment: development + needs: [test, lint] + runs-on: ubuntu-latest + env: + VITE_API_URL: ${{ secrets.API_URL }} + VITE_FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }} + VITE_WEB_URL: ${{ secrets.WEB_URL }} + + steps: + - uses: actions/checkout@v2 + + - name: Setup pnpm + uses: pnpm/action-setup@v2.0.1 + with: + version: latest + + - name: Install Dependencies + run: pnpm install + working-directory: extension + + - name: Build + run: pnpm run build + working-directory: extension + + - name: Zip Extension + run: | + cd dist + zip -r extension.zip . + working-directory: extension + + - name: Upload Artifacts + uses: actions/upload-artifact@v2 + with: + name: chrome-extension-artifacts + path: extension/dist/extension.zip + + build-prod: + environment: production needs: [test, lint] runs-on: ubuntu-latest + env: + VITE_API_URL: ${{ secrets.API_URL }} + VITE_FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }} + VITE_WEB_URL: ${{ secrets.WEB_URL }} steps: - uses: actions/checkout@v2 @@ -119,7 +156,7 @@ jobs: release: name: Release - needs: [build] + needs: [build-prod] if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest steps: