-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
108 lines (103 loc) · 3.45 KB
/
action.yml
File metadata and controls
108 lines (103 loc) · 3.45 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Satel shopify theme deployment
description: Deploys theme(s) to shopify store(s)
inputs:
store-name:
description: Name of the store
required: true
api-key:
description: API key for the store
required: true
theme-env:
description: Name of the environment for theme deployment
required: true
main-theme-id:
description: ID of main theme
required: false
repo-name:
description: Name of the current repo
required: false
github-token:
description: Token for GraphQL calls
required: false
# https://shopify.dev/docs/api/admin-rest/2025-04/resources/theme
shopify-api-version:
description: Shopify api version
required: false
default: "2025-04"
theme-files-location:
description: location of all the theme files
required: false
current-branch-name:
description: Provides current branch name
required: false
tag-name:
description: Provides current tag name
required: false
org-name:
description: Name of the github organization
required: false
run-id:
description: Number of times a PR build has ran
required: false
is-prd:
description: Check if the theme is deploying on PRD store
required: false
outputs:
preview-link: # id of output
description: "Theme preview link"
value: ${{ steps.deploy-pr.outputs.preview_link }}
theme_id:
description: "ID of theme created, used for lighthouse check"
value: ${{ steps.deploy-pr.outputs.theme_id }}
runs:
using: "composite"
steps:
- name: Delete Old Themes
env:
STORE_NAME: ${{ inputs.store-name }}
API_KEY: ${{ inputs.api-key }}
REPO_NAME: ${{ inputs.repo-name }}
GITHUB_TOKEN: ${{ inputs.github-token }}
SHOPIFY_API_VERSION: ${{ inputs.shopify-api-version }}
WORK_DIR: ${{ inputs.theme-files-location }}
BRANCH_NAME: ${{ inputs.current-branch-name }}
TAG_NAME: ${{ inputs.tag-name }}
ORG_NAME: ${{ inputs.org-name }}
run: |
if [[ -z "${{ inputs.tag-name }}" ]]; then
${{ github.action_path }}/scripts/DeleteInactiveThemes.sh
fi
shell: bash
- name: Deploy a PR or a Tag
id: deploy-pr
# Only run on the 1st commit, as per Alex.
# The rest will be done directly on Shopify as bug fixes.
if: ${{ inputs.run-id == '1' }}
env:
STORE_NAME: ${{ inputs.store-name }}
API_KEY: ${{ inputs.api-key }}
THEME_ENV: ${{ inputs.theme-env }}
SHOPIFY_API_VERSION: ${{ inputs.shopify-api-version }}
WORK_DIR: ${{ inputs.theme-files-location }}
BRANCH_NAME: ${{ inputs.current-branch-name }}
TAG_NAME: ${{ inputs.tag-name }}
run: |
if [[ "${{ inputs.current-branch-name }}" != "main" ]] || [[ -n "${{ inputs.tag-name }}" ]]; then
${{ github.action_path }}/scripts/DeployPRorTag.sh
fi
shell: bash
- name: Deploy Main
env:
STORE_NAME: ${{ inputs.store-name }}
API_KEY: ${{ inputs.api-key }}
BRANCH_NAME: ${{ inputs.current-branch-name }}
MAIN_THEME_IDS: ${{ inputs.main-theme-id }}
THEME_ENV: ${{ inputs.theme-env }}
SHOPIFY_API_VERSION: ${{ inputs.shopify-api-version }}
WORK_DIR: ${{ inputs.theme-files-location }}
PRD_PARAMETER: ${{ inputs.is-prd }}
run: |
if [[ "${{ inputs.current-branch-name }}" == 'main' ]]; then
${{ github.action_path }}/scripts/DeployMain.sh
fi
shell: bash