chrome-ext-react
Version:
Chrome Extension Boilerplate with React and TypeScript
42 lines (32 loc) • 937 B
YAML
name: Build Stage
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci
- name: Build
run: npm run dev
- name: Renaming dist directory
run: |
REPO_NAME=$(echo ${{ github.repository }} | awk -F / '{print $2}')
BRANCH_NAME=$(echo ${{ github.ref }} | awk -F / '{print $3}')
NEW_NAME="$REPO_NAME-$BRANCH_NAME"
mv dist $NEW_NAME
echo "NEW_NAME=$NEW_NAME" >> $GITHUB_ENV
- name: Upload build as artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.NEW_NAME }}
path: ${{ env.NEW_NAME }}/*