Taobin-Recipe-Manager/.github/workflows/publish.yml
pakintada@gmail.com 8cf5a2e14c ci(release): 🐛 fix workflow error
fix a bug where client.zip existed
2024-04-01 09:50:47 +07:00

56 lines
1.4 KiB
YAML

name: Web Client Package
on:
pull_request:
types:
- closed
branches:
- release
jobs:
build:
permissions: write-all
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://npm.pkg.github.com/
- name: Install Angular CLI
run: npm install -g @angular/cli
- name: Install dependencies
run: |
pwd
cd client
ls
npm install
- name: Build Angular project
run: |
pwd
cd client
ls
ng build ${{ inputs.project_name }}
- name: Remove Old Client Zip
run: |
pwd
cd client/dist/
ls
rm -f client.zip
rm -rf client
ls
- name: Zip files
uses: vimtor/action-zip@v1.2
with:
files: client/dist/client/
dest: client/dist/client.zip
- name: Create Release
uses: svenstaro/upload-release-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: false
prerelease: false
body: ${{ inputs.release_notes }}
file: client/dist/client.zip
make_latest: true