Build React App #4
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 React App and Add to Release | |
run-name: | | |
Build React App${{ github.event_name == 'release' && ' and add to Release' || '' }} | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
build-and-upload: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install Dependencies | |
working-directory: ./web_client | |
run: npm install | |
- name: Build React App | |
working-directory: ./web_client | |
run: npm run build | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ./web_client/dist | |
path: ./cocktailberry_web_client.tar.gz | |
- name: Upload binaries to release | |
if: github.event_name == 'release' | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ./web_client/dist | |
asset_name: cocktailberry_web_client.tar.gz | |
tag: ${{ github.event.release.tag_name }} |