Skip to content

Commit 3a8ddfc

Browse files
committed
Update Deploy workflow
Use Netlify Build Hooks
1 parent 894e895 commit 3a8ddfc

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

.github/workflows/deploy-production-push.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
- 'package-lock.json'
1919
- 'package.json'
2020
# run only if 'web' files were changed
21-
- name: Add deployable commit to 'production' branch
21+
- name: Run the Netlify build hook
2222
env:
23-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
23+
DEPLOY_URL: ${{ secrets.NETLIFY_BUILD_HOOK_URL }}
2424
DEPLOY_TRIGGER: ${{ github.event_name }}
2525
if: steps.filter.outputs.web == 'true'
2626
run: |

bin/deploy

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
#!/bin/bash
22
deploy_branch() {
3-
git config --global user.email "[email protected]"
4-
git config --global user.name "30secondsofcode"
5-
git checkout -b $1
6-
git reset --hard origin/master
7-
git commit -m "[$(date +%Y.%m.%d_%H:%M)] Deployment/${DEPLOY_TRIGGER}" --allow-empty
8-
git push --force --quiet "https://${GH_TOKEN}@github.com/Chalarangelo/30-seconds-of-code.git" $1 > /dev/null 2>&1
3+
curl -X POST -d {} "${DEPLOY_URL}?trigger_title='[$(date +%Y.%m.%d_%H:%M)] Deployment/${DEPLOY_TRIGGER}'&trigger_branch=${1}" > /dev/null 2>&1
94
}
105

116
deploy_production() {

0 commit comments

Comments
 (0)