Github CI/CD for Forge Custom UI App Issue

Hello All,

i have ben trying to set up CI/CD for Forge custom UI app and there’s alot of issues i faced, here my script:

name: Deploy Forge App
'on':
  push:
    branches:
      - master
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Install Node.js
        uses: actions/setup-node@v2
        with:
          node-version: 18
      - name: Install libsecret
        run: sudo apt install gnome-keyring
      - name: Install Forge CLI
        run: npm install -g @forge/cli@latest
      - name: Install Forge UI Package
        run: npm install @forge/ui@latest
      - name: Install dependencies
        run: npm install
      - name: Build app
        run: |
          cd static/hello-world
          npm install
          npm run build
          pwd
          ls -a      
      - name: Install libsecret
        run: sudo apt-get install -y libsecret-1-0
      - name: Deploy to Atlassian site
        run: >
          cd /home/runner/work/ForgePipeline/ForgePipeline/
         
          npm install @forge/cli@latest --no-optional          
          
          npm install react-scripts --save
          npm audit fix --force
                  
          npx forge settings set usage-analytics true
          
          npx forge deploy -e production
         
        env:
          FORGE_ENV: production
          FORGE_EMAIL: '${{ secrets.FORGE_EMAIL }}'
          FORGE_API_TOKEN: '${{ secrets.FORGE_TOKEN }}'

Everything works fine with the above code, it says “Deployed ForgeTestApp to the production environment” but where? i tried the following command “npx forge deploy -e production --site testapp.atlassian.net” then it says “Error: unknown option ‘–site’”

If i give forge install then i get the following error:
“Error: Prompts can not be meaningfully rendered in non-TTY environments”

Then i tried the following command “npx forge install --upgrade --site testapp.atlassian.net --product Jira --non-interactive -e production --verbose”
even this did not work.

Can you please help me out here?

May be this reply is helpful for you. You can see this here> https://developer.atlassian.com/platform/forge/set-up-cicd/

Hello, here is an example

name:  Deploy

on:
  release:
    types: [published]

jobs:
  deploy:
    name: Deploy my app to staging

    runs-on: macos-12

    strategy:
      matrix:
        node-version: [16.14.2]

    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - uses: chrnorm/deployment-action@v2
        name: staging Deploy
        id: deployment
        with:
          token: '${{ github.token }}'
          environment: staging
          environment-url:

      - name: Set up Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
          registry-url: 'https://npm.pkg.github.com'
          scope: '@yourscope'

      - name: Install forge
        run: npm install -g @forge/cli

      - name: Install dependencies
        working-directory: ./static/app
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_TEST }}
        run: npm install

      - name: Run react build
        working-directory: ./static/app
        run: CI=false npm run build

      - name: Install dependencies in the root folder
        run: npm install

      - name: Analytics
        run: forge settings set usage-analytics false

      - name: Login to forge
        run: forge login -u ${{ secrets.EMAIL_staging }} -t ${{ secrets.TOKEN_staging }}

      - name: Deploy to staging
        run: forge deploy -e staging```
1 Like