Merge branch 'develop' of https://github.com/shridhar-tl/jira-assista… #126
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
# This workflow will build Jira Assistant plugin and publish to Jira Cloud staging environment by default | |
name: Deploy Jira Cloud App | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: 'Choose environment to publish' | |
default: 'staging' | |
required: true | |
type: choice | |
options: | |
- development | |
- staging | |
- production | |
forgeEmail: | |
description: 'Atlassian Email id' | |
required: true | |
type: string | |
forgeApiToken: | |
description: 'Atlassian API token' | |
required: true | |
type: string | |
push: | |
branches: [ package, master ] | |
pull_request: | |
branches: [ package, master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
CI: "" | |
FORGE_ENV: staging | |
FORGE_EMAIL: ${{ secrets.FORGE_EMAIL }} | |
FORGE_API_TOKEN: ${{ secrets.FORGE_API_TOKEN }} | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Set env based on branch | |
run: | | |
echo "FORGE_ENV=production" >> $GITHUB_ENV | |
if: startsWith(github.ref, 'refs/heads/master') | |
- name: Override env with user inputs | |
run: | | |
echo "FORGE_ENV=${{ github.event.inputs.environment }}" >> $GITHUB_ENV | |
echo "FORGE_EMAIL=${{ github.event.inputs.forgeEmail }}" >> $GITHUB_ENV | |
echo "FORGE_API_TOKEN=${{ github.event.inputs.forgeApiToken }}" >> $GITHUB_ENV | |
if: startsWith(github.event_name, 'workflow_dispatch') | |
- run: echo Deploying ${{github.ref}} to ${{env.FORGE_ENV}} | |
- run: npm install -g @forge/cli@latest | |
- run: npm install --force | |
- run: npm run build-plugin | |
- run: forge settings set usage-analytics false | |
- run: forge deploy -e $FORGE_ENV | |
- run: forge logout |