Newer
Older
schrodinger / .github / workflows / node.js.yml
@biosfood biosfood on 26 Dec 2022 1 KB manually run github workflows
name: Node.js CI

on:
  workflow_dispatch:
    inputs:
      tag_name:
        description: "Tag name"
        required: true
        type: string

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: setup npm
      uses: actions/setup-node@v3
      with:
        node-version: 16.17.0
        cache: 'npm'
    - name: load libaries
      run: npm ci
    - name: build article files
      run: npm run build
    - name: create zip
      run: (cd build && zip -r ../article.zip .)
    - name: Create Release
      id: create_release
      uses: actions/create-release@v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        tag_name: ${{ inputs.tag_name }}
        release_name: Release ${{ inputs.tag_name }}
        draft: false
        prerelease: false
    - name: Upload Release Asset
      id: upload-release-asset 
      uses: actions/upload-release-asset@v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        upload_url: ${{ steps.create_release.outputs.upload_url }}
        asset_path: ./article.zip
        asset_name: article.zip
        asset_content_type: application/zip