Skip to content

Add a staging github workflow too #9

Add a staging github workflow too

Add a staging github workflow too #9

Workflow file for this run

name: Deploy Forge App to Jira
on:
pull_request:
branches:
- main
push:
branches:
- main
# Set Forge credentials
# https://developer.atlassian.com/platform/forge/cli-reference/login/
# https://developer.atlassian.com/platform/forge/set-up-cicd/#step-2--define-your-login-details-as-variables
env:
FORGE_EMAIL: ${{ secrets.FORGE_EMAIL }}
FORGE_API_TOKEN: ${{ secrets.FORGE_API_TOKEN }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v4 # https://github.com/actions/checkout
# Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v4 # https://github.com/actions/setup-node
with:
node-version: "20" # https://nodejs.org/en
# Install project dependencies
- name: Install dependencies
run: npm install
# Install Forge CLI
- name: Install Forge CLI
run: npm install -g @forge/cli
# Enable Forge analytics
# https://developer.atlassian.com/platform/forge/set-up-cicd/#understanding-usage-analytics
- name: Enable Forge analytics
run: forge settings set usage-analytics true
# Run Forge lint
- name: Run Forge lint
run: forge lint --fix
# Deploy Forge App
# https://developer.atlassian.com/platform/forge/staging-and-production-apps/#deploy-to-a-specific-environment
- name: Deploy Forge App
run: |
if [ "${{ github.event_name }}" == "push" ]; then
forge deploy -e production
else
forge deploy -e staging
fi
# Install Forge app dependencies
# https://developer.atlassian.com/platform/forge/cli-reference/install/
- name: Install Forge dependencies
if: github.event_name == 'pull_request'
run: forge install -e staging -s gitauto.atlassian.net --p Jira --upgrade --confirm-scopes --non-interactive --verbose