Version Deployment #28
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
# The purpose of this workflow file is to | |
# deploy the app and upload the | |
# release assets for the four platforms | |
# (browser, Linux, Windows, MacOS) automatically | |
name: Version Deployment | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
deploy_web: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Deploy on Web | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
npm install | |
npm run deploy:web -- --repo=https://x-access-token:[email protected]/CATcher-org/CATcher.git | |
draft_release: | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.set_upload_url.outputs.upload_url }} | |
version_num: ${{ steps.set_version.outputs.version_num }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Get Version Number | |
id: get_version | |
uses: tyankatsu0105/read-package-version-actions@v1 | |
- name: Set Version Number | |
id: set_version | |
run: echo "::set-output name=version_num::${{ steps.get_version.outputs.version }}" | |
- name: Create Draft Release | |
id: draft_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: V${{ steps.get_version.outputs.version }} | |
release_name: V${{ steps.get_version.outputs.version }} | |
draft: true | |
prerelease: false | |
- name: Set upload_url Context | |
id: set_upload_url | |
run: echo "::set-output name=upload_url::${{ steps.draft_release.outputs.upload_url }}" |