Update release.yml #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release | |
on: | |
push: | |
tags: | |
- 'v*' # Triggers on tags that start with 'v' | |
jobs: | |
build: | |
name: Build Vite React App | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm install | |
- name: Build the app | |
env: | |
BASE_PATH: /3dstories | |
run: npm run build -- --base=$BASE_PATH | |
- name: Create tarball of dist folder | |
run: tar -czf dist.tar.gz -C dist . | |
- name: Upload to release | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-tarball | |
path: dist.tar.gz | |
release: | |
name: Create GitHub Release | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Download build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist-tarball | |
- name: Create a Draft Release with the tarball | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: dist.tar.gz | |
draft: true | |
token: ${{ secrets.GITHUB_TOKEN }} |