Skip to content

build: Update deployment workflow for dev branch #53

build: Update deployment workflow for dev branch

build: Update deployment workflow for dev branch #53

Workflow file for this run

name: Deploy
on:
push:
branches:
- stable
- dev
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
- name: Install dependencies
uses: bahmutov/npm-install@v1
- name: Build project
run: |
if [ "${{ github.ref }}" = "refs/heads/stable" ]; then
npm run build # Production build for stable
else
npm run build:dev # Dev build for dev branch
fi
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build-files
path: ./dist
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: build-files
path: ./dist
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
destination_dir: ${{ github.ref == 'refs/heads/stable' && '' || 'beta' }}
keep_files: ${{ github.ref == 'refs/heads/stable' && true || false }}