-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
86 lines (77 loc) · 3.02 KB
/
action.yml
File metadata and controls
86 lines (77 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: "ForgeDeploy"
description: "Deploy and optionally install an Atlassian Forge application to a specified environment and Atlassian site"
inputs:
email:
description: "Atlassian account email address used for authentication with Forge CLI"
required: true
apiToken:
description: "Atlassian API token for authentication. Generate at https://id.atlassian.com/manage/api-tokens"
required: true
environment:
description: "Forge environment to deploy to. Common values: development, staging, production"
required: true
siteUrl:
description: "Atlassian site URL where the app will be installed. Format: yourcompany.atlassian.net (without https://). Required when installToSite is true"
required: false
product:
description: "Target Atlassian product. Valid values: jira, confluence"
required: true
installToSite:
description: "Whether to install the app to the specified site after deployment. Set to false to skip installation (useful if the app is already installed or you only want to deploy)"
required: false
default: "true"
isCustomApp:
description: "Set to true if the Forge app is located in a subdirectory rather than the repository root. When true, customAppPath must also be provided"
required: false
default: "false"
customAppPath:
description: "Relative path to the custom Forge app directory from the repository root. Required when isCustomApp is true. Example: apps/my-forge-app"
required: false
runs:
using: "composite"
steps:
- uses: actions/setup-node@v3
with:
node-version: "18"
- name: Install Forge CLI
run: npm install -g @forge/cli
shell: bash
- name: Disable Forge usage analytics
run: forge settings set usage-analytics false
shell: bash
- name: Install root backend dependencies
run: npm install
shell: bash
- name: Install frontend dependencies (custom app only)
if: inputs.isCustomApp == 'true'
run: npm install
shell: bash
working-directory: ${{ inputs.customAppPath }}
- name: Build frontend (custom app only)
if: inputs.isCustomApp == 'true'
run: npm run build
shell: bash
working-directory: ${{ inputs.customAppPath }}
- name: Deploy Forge app
run: forge deploy --environment "${ENVIRONMENT}" --non-interactive
shell: bash
env:
ENVIRONMENT: ${{ inputs.environment }}
FORGE_EMAIL: ${{ inputs.email }}
FORGE_API_TOKEN: ${{ inputs.apiToken }}
- name: Install Forge app (optional)
if: inputs.installToSite != 'false'
run: |
forge install \
--product "${PRODUCT}" \
--site "${SITE_URL}" \
--environment "${ENVIRONMENT}" \
--non-interactive
shell: bash
env:
INSTALL_TO_SITE: ${{ inputs.installToSite }}
PRODUCT: ${{ inputs.product }}
SITE_URL: ${{ inputs.siteUrl }}
ENVIRONMENT: ${{ inputs.environment }}
FORGE_EMAIL: ${{ inputs.email }}
FORGE_API_TOKEN: ${{ inputs.apiToken }}