Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual & remote (HTTP) deployments through GitHub UI/API #147

Merged
merged 31 commits into from
Oct 17, 2020
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2815707
Added trigger on check_run
Demmonius Aug 19, 2020
d9ae4e9
Changed trigger engine
Demmonius Aug 19, 2020
797dada
Trying asking arguments
Demmonius Aug 19, 2020
bf06175
Working trigger
Demmonius Aug 19, 2020
357ae45
New DOC
Demmonius Sep 21, 2020
636dc0b
Update deploy-zeit-staging.yml
Demmonius Sep 21, 2020
74f774f
Merge branch 'v2-mst-aptd-gcms-lcz-sty' into custom-actions-trigger
Demmonius Sep 21, 2020
7dd0c68
Rename client > customer
Vadorequest Sep 21, 2020
1536f5d
Echo CUSTOMER_TO_DEPLOY for easier debug
Vadorequest Sep 21, 2020
1edce41
Improve inline doc
Vadorequest Sep 21, 2020
94c7fb5
Make customer input required when deploying through workflow_dispatch
Vadorequest Sep 21, 2020
9252774
Improve doc
Vadorequest Sep 21, 2020
b2e6edc
Improve/fix doc
Vadorequest Sep 21, 2020
e418e07
Fix usage of inputs in curl example
Vadorequest Sep 21, 2020
93d4194
Update doc and mention WORKFLOW_DISPATCH doc
Vadorequest Sep 21, 2020
317caeb
Update deploy-zeit-production.yml
Demmonius Sep 22, 2020
a604183
Update deploy-zeit-staging.yml
Demmonius Sep 22, 2020
ef2492c
Misc documentation
Vadorequest Oct 8, 2020
5f1809b
Misc doc + add more variable prints for debug (echo)
Vadorequest Oct 8, 2020
536d09a
Made debug easier
Demmonius Oct 16, 2020
acca90e
Updated set-env method
Demmonius Oct 16, 2020
0f21b14
Updated debug everywhere
Demmonius Oct 16, 2020
bfba928
Add comments everywhere...
Vadorequest Oct 17, 2020
52dc2f4
Print $ALL_ZEIT_DEPLOYMENTS for debug
Vadorequest Oct 17, 2020
aa6eb0a
Refactor and extract/print VERCEL_TEAM_ID
Vadorequest Oct 17, 2020
d158fc1
Add VERCEL_PROJECT_NAME and add TODO + print more variable for easier…
Vadorequest Oct 17, 2020
8921156
Adapt production workflow (VERCEL_TEAM_ID, VERCEL_PROJECT_NAME) + pri…
Vadorequest Oct 17, 2020
ed670a4
Add more info on commit messages (commit ID + deployment url) for bet…
Vadorequest Oct 17, 2020
55eb626
Refactor VERCEL_FETCH_DEPLOYMENTS_API_ENDPOINT + print value for easi…
Vadorequest Oct 17, 2020
1bff0b4
Reduce minimum scores in staging to avoid failing because score is to…
Vadorequest Oct 17, 2020
a2b1d89
Try to fix deployment by concatenating strings differently
Vadorequest Oct 17, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update deploy-zeit-staging.yml
Demmonius authored Sep 21, 2020
commit 636dc0bf61ff44e0b27d2b699f2268ed34d6afab
13 changes: 11 additions & 2 deletions .github/workflows/deploy-zeit-staging.yml
Original file line number Diff line number Diff line change
@@ -14,6 +14,10 @@ on:
branches-ignore:
- 'master'
workflow_dispatch: # Allow manual trigger via a button in github or a HTTP call: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#manually-running-a-workflow
inputs:
client:
description: 'Client to deploy'
required: false


jobs:
@@ -45,10 +49,15 @@ jobs:
run: |
# Print the version of the "now" CLI being used (helps debugging)
now --version
# Selecting client to deploy
MANUAL_TRIGGER_CLIENT="${{ github.event.inputs.client}}"
CLIENT_TO_DEPLOY="${MANUAL_TRIGGER_CLIENT:-$(cat now.json | jq -r '.build.env.NEXT_PUBLIC_CUSTOMER_REF')}"
# Deploy the customer on Vercel using the customer specified in now.json (e.g: "yarn deploy:customer1")
# Store the output in a variable so we can extract metadata from it
ZEIT_DEPLOYMENT_OUTPUT=`yarn deploy:$(cat now.json | jq -r '.build.env.NEXT_PUBLIC_CUSTOMER_REF') --token $ZEIT_TOKEN`
ZEIT_DEPLOYMENT_OUTPUT=`yarn deploy:$CLIENT_TO_DEPLOY --token $ZEIT_TOKEN`
# Extract the Vercel deployment url from the deployment output
ZEIT_DEPLOYMENT_URL=`echo $ZEIT_DEPLOYMENT_OUTPUT | egrep -o 'https?://[^ ]+.vercel.app'`
@@ -61,7 +70,7 @@ jobs:
if [[ ${CURRENT_BRANCH##*/} =~ ^v[0-9]{1,}- ]]; then # Checking if pattern matches with "vX-" where X is a number
ZEIT_DEPLOYMENT_ALIAS=${CURRENT_BRANCH##*/}
else
ZEIT_DEPLOYMENT_ALIAS=$(cat now.json | jq -r '.name')-${CURRENT_BRANCH##*/}
ZEIT_DEPLOYMENT_ALIAS=$(cat now.$CLIENT_TO_DEPLOY.staging.json | jq -r '.name')-${CURRENT_BRANCH##*/}
fi
# Zeit alias only allows 41 characters in the domain name, so we only keep the first 41 (41 = 53 - 11 - 1) characters (because Zeit needs 7 chars for ".vercel.app" at the end of the domain name, and count starts at 1, not 0)