@@ -39,14 +39,6 @@ inputs:
3939 description : Deployment Subdomain name
4040 required : false
4141 default : " "
42- node_version :
43- description : Node version or arguments compatible with `nvm install`
44- required : false
45- default : " "
46- use_nvm :
47- description : Enables you to disable nvm altogether
48- required : false
49- default : true
5042outputs :
5143 NETLIFY_OUTPUT :
5244 description : netlify command output
@@ -59,82 +51,20 @@ outputs:
5951runs :
6052 using : composite
6153 steps :
62- - name : " Install node through NVM if needed"
63- shell : bash
64- run : |
65- if [[ "${{ inputs.use_nvm }}" == "true" ]] && ([[ -n "${{ inputs.node_version }}" ]] || [[ -e ".nvmrc" ]])
66- then
67- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
68- [ -s "$HOME/.nvm/nvm.sh" ] && \. "$HOME/.nvm/nvm.sh"
69- if [[ -n "${{ inputs.node_version }}" ]]
70- then
71- nvm install "${{ inputs.node_version }}"
72- else
73- nvm install
74- fi
75- else
76- echo "Node installation has been omitted"
77- fi
78- - name : " Run install command"
79- shell : bash
80- run : |
81- if [[ -n "${{ inputs.install_command }}" ]]
82- then
83- ${{ inputs.install_command }}
84- elif [[ -f yarn.lock ]]
85- then
86- yarn
87- else
88- npm i
89- fi
90- - name : " Run build command"
91- shell : bash
92- run : |
93- if [[ -n "${{ inputs.build_command }}" ]]
94- then
95- ${{ inputs.build_command }}
96- else
97- npm run build
98- fi
99- - name : " Deploy to Netlify"
100- shell : bash
101- run : |
102- export NETLIFY_SITE_ID="${{ inputs.NETLIFY_SITE_ID }}"
103- export NETLIFY_AUTH_TOKEN="${{ inputs.NETLIFY_AUTH_TOKEN }}"
104-
105- COMMAND="netlify deploy --dir=${{ inputs.build_directory }} --functions=${{ inputs.functions_directory }} --message=\"${{ inputs.NETLIFY_DEPLOY_MESSAGE }}\""
106-
107- if [[ "${{ inputs.NETLIFY_DEPLOY_TO_PROD }}" == "true" ]]
108- then
109- COMMAND+=" --prod"
110- elif [[ -n "${{ inputs.deploy_alias }}" ]]
111- then
112- COMMAND+=" --alias ${{ inputs.deploy_alias }}"
113- fi
114-
115- # Deploy with netlify
116- OUTPUT=$(sh -c "$COMMAND")
117-
118- NETLIFY_OUTPUT=$(echo "$OUTPUT")
119- NETLIFY_PREVIEW_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*(--)[a-zA-Z0-9./?=_-]*') #Unique key: --
120- NETLIFY_LOGS_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://app.netlify.com/[a-zA-Z0-9./?=_-]*') #Unique key: app.netlify.com
121- NETLIFY_LIVE_URL=$(echo "$OUTPUT" | grep -Eo '(http|https)://[a-zA-Z0-9./?=_-]*' | grep -Eov "netlify.com") #Unique key: don't containr -- and app.netlify.com
122-
123- echo "NETLIFY_OUTPUT<<EOF" >> $GITHUB_ENV
124- echo "$NETLIFY_OUTPUT" >> $GITHUB_ENV
125- echo "EOF" >> $GITHUB_ENV
126-
127- echo "NETLIFY_PREVIEW_URL<<EOF" >> $GITHUB_ENV
128- echo "$NETLIFY_PREVIEW_URL" >> $GITHUB_ENV
129- echo "EOF" >> $GITHUB_ENV
130-
131- echo "NETLIFY_LOGS_URL<<EOF" >> $GITHUB_ENV
132- echo "$NETLIFY_LOGS_URL" >> $GITHUB_ENV
133- echo "EOF" >> $GITHUB_ENV
54+ - run : ${{ github.action_path }}/entrypoint.sh
55+ shell : bash
56+ env :
57+ NETLIFY_AUTH_TOKEN : ${{ inputs.NETLIFY_AUTH_TOKEN }}
58+ NETLIFY_SITE_ID : ${{ inputs.NETLIFY_SITE_ID }}
59+ NETLIFY_DEPLOY_TO_PROD : ${{ inputs.NETLIFY_DEPLOY_TO_PROD }}
60+ NETLIFY_DEPLOY_MESSAGE : ${{ inputs.NETLIFY_DEPLOY_MESSAGE }}
61+ BUILD_DIRECTORY : ${{ inputs.build_directory }}
62+ FUNCTIONS_DIRECTORY : ${{ inputs.functions_directory }}
63+ INSTALL_COMMAND : ${{ inputs.install_command }}
64+ BUILD_COMMAND : ${{ inputs.build_command }}
65+ DEPLOY_ALIAS : ${{ inputs.deploy_alias }}
13466
135- echo "NETLIFY_LIVE_URL<<EOF" >> $GITHUB_ENV
136- echo "$NETLIFY_LIVE_URL" >> $GITHUB_ENV
137- echo "EOF" >> $GITHUB_ENV
67+
13868branding :
13969 icon : activity
14070 color : blue
0 commit comments