Skip to content

v0.3 - Chrome extension #39

v0.3 - Chrome extension

v0.3 - Chrome extension #39

Workflow file for this run

name: Build Chrome Extension
on:
push:
branches: [main]
paths: ["extension/**", ".github/workflows/extension.yml"]
pull_request:
branches: [main]
paths: ["extension/**", ".github/workflows/extension.yml"]
release:
types: [created]
permissions:
contents: write
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "16"
- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: latest
- name: Cache .pnpm-store
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.OS }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install Dependencies
run: pnpm install
working-directory: extension
lint:
needs: setup
runs-on: ubuntu-latest
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: Lint
run: pnpm run lint
working-directory: extension
test:
needs: setup
runs-on: ubuntu-latest
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: Run Tests
run: pnpm run test
working-directory: extension
build-dev:
environment: development
if: github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main'
continue-on-error: true
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-dev.zip .
working-directory: extension
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: chrome-extension-artifacts-dev
path: extension/dist/extension-dev.zip
build-prod:
environment: production
if: github.event_name == 'release'
continue-on-error: true
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
release:
name: Release
needs: [build-prod]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: chrome-extension-artifacts
path: artifacts
- uses: softprops/action-gh-release@v1
with:
files: artifacts/*