Build UI and Release #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 UI and Release | |
on: | |
workflow_dispatch: | |
inputs: | |
tag_name: | |
description: 'Tag name for the release' | |
required: true | |
type: string | |
release_name: | |
description: 'Release name' | |
required: false | |
type: string | |
default: 'Release' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install archive tools | |
run: sudo apt-get install -y zip | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '22.6.0' | |
- name: Install dependencies | |
run: npm install --prefix web | |
- name: Build UI | |
run: npm run build --prefix web | |
- name: Clean up unnecessary files | |
run: | | |
find web/ -mindepth 1 -maxdepth 1 ! -name 'build' -exec rm -rf {} + | |
- name: Create a zip archive | |
run: | | |
zip -r p-clothing.zip . -x "*.git/*" -x ".github/*" | |
- name: Create GitHub Release | |
uses: marvinpinto/[email protected] | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
automatic_release_tag: ${{ github.event.inputs.tag_name || github.ref_name }} | |
title: ${{ github.event.inputs.release_name || 'Release' }} ${{ github.event.inputs.tag_name || github.ref_name }} | |
files: p-clothing.zip | |
draft: false | |
prerelease: false |