-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2176 from iFixit/strapi--deploy-with-actions
Strapi: Deploy with actions
- Loading branch information
Showing
2 changed files
with
35 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
set -o pipefail -e nounset | ||
|
||
export STRAPI_COMMIT=$(git rev-parse HEAD) | ||
DEPLOY_TAG=last-strapi-deploy | ||
SLACK="/home/ifixit/Code/Exec/slackAnnounce.php" | ||
|
||
git fetch --tags --quiet | ||
|
||
SUBJECT=$(git rev-list --format="%s" --max-count=1 "$STRAPI_COMMIT" | tail -1) | ||
COMMIT_LINK="<https://$BUILD_REPO/commit/$STRAPI_COMMIT|${SUBJECT}>" | ||
DEPLOY_LOG_TS=$($SLACK --message="Strapi Deploy: Deploying ${COMMIT_LINK} - 📃 <$BUILD_LOG_URL|build log>") | ||
$SLACK --thread_ts="$DEPLOY_LOG_TS" --message="Building Docker image" | ||
|
||
strapi_dir="$(git rev-parse --show-toplevel)/backend" | ||
cd "$strapi_dir" | ||
./build-docker-and-push | ||
|
||
$SLACK --thread_ts="$DEPLOY_LOG_TS" --message="Deploying" | ||
# Yes, capistrano is only available in our main repo... | ||
# This wont be a problem when these repos are joined though :-) | ||
cd /home/ifixit/Code | ||
cap prod strapi:deploy | ||
|
||
## Deploy Tag | ||
cd "$strapi_dir" | ||
git tag -f "$DEPLOY_TAG" "$STRAPI_COMMIT" | ||
git push -f origin "$DEPLOY_TAG" | ||
|
||
$SLACK --thread_ts="$DEPLOY_LOG_TS" --message="Deploy complete!" |
70319a9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
react-commerce – ./frontend
react-commerce-ifixit.vercel.app
react-commerce-git-main-ifixit.vercel.app
react-commerce.vercel.app
70319a9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
react-commerce-prod – ./frontend
react-commerce-prod-git-main-ifixit.vercel.app
react-commerce-prod-ifixit.vercel.app
react-commerce-prod.vercel.app