mirror of
https://github.com/thedevs-network/kutt-extension.git
synced 2026-02-03 05:43:24 +00:00
77 lines
1.7 KiB
YAML
77 lines
1.7 KiB
YAML
name: Build and Deploy
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci --legacy-peer-deps
|
|
|
|
- name: Build for all browsers
|
|
run: npm run build
|
|
|
|
- name: Upload Chrome extension artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: chrome-extension
|
|
path: extension/chrome.zip
|
|
|
|
- name: Upload Firefox extension artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: firefox-extension
|
|
path: extension/firefox.xpi
|
|
|
|
- name: Upload Opera extension artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: opera-extension
|
|
path: extension/opera.crx
|
|
|
|
deploy:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci --legacy-peer-deps
|
|
|
|
- name: Build for all browsers
|
|
run: npm run build
|
|
|
|
- name: Deploy to extension branch
|
|
uses: peaceiris/actions-gh-pages@v4
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ./extension
|
|
publish_branch: extension
|
|
keep_files: false
|