Skip to content

Commit

Permalink
Updating actions to only run when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
ncpleslie committed Mar 27, 2024
1 parent 90cbb20 commit 58a19cb
Showing 1 changed file with 44 additions and 7 deletions.
51 changes: 44 additions & 7 deletions .github/workflows/extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/[email protected]
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
Expand Down Expand Up @@ -119,7 +156,7 @@ jobs:

release:
name: Release
needs: [build]
needs: [build-prod]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 58a19cb

Please sign in to comment.