From 60f70137b2655fa880762a9218931f4c98b8fe04 Mon Sep 17 00:00:00 2001 From: Hiroshi Nishio Date: Wed, 27 Nov 2024 14:35:21 +0900 Subject: [PATCH] Add a CICD GitHub action workflow --- .github/workflows/deploy.yml | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..a5adea1 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,52 @@ +name: Deploy Forge App to Jira + +on: + push: + branches: + - main + +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 + + # Authenticate Forge CLI + # https://developer.atlassian.com/platform/forge/set-up-cicd/#step-2--define-your-login-details-as-variables + - name: Authenticate Forge CLI + run: forge login --email ${{ secrets.FORGE_EMAIL }} --token ${{ secrets.FORGE_API_TOKEN }} + + # 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: forge deploy -e production + + # Install Forge app dependencies + - name: Install Forge dependencies + run: forge install -e production