Skip to content
This repository was archived by the owner on Sep 6, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.next
node_modules
node_modules
.env
30 changes: 30 additions & 0 deletions scripts/update-and-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# access to .env
set -o allexport; source .env; set +o allexport

# check for vars before using
if [ -z "$APP_ID" ] || [ -z "$DIGITAL_OCEAN_API_TOKEN" ]; then
echo ''
echo 'Missing $APP_ID and $DIGITAL_OCEAN_API_TOKEN environment variables'
exit 1
fi

echo 'Stashing current files and checking out main'
git stash
git checkout main

echo 'Installing latest version of'
echo '@atom-learning/components'
echo '@atom-learning/theme'
echo '@atom-learning/icons'

yarn add @atom-learning/components @atom-learning/theme @atom-learning/icons

echo 'Committing change and pushing to remote'
git add package.json yarn.lock
git commit -m "chore: release updated components, theme & icons"
git push

echo 'Triggering Digital Ocean App Platform build'
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $DIGITAL_OCEAN_API_TOKEN" "https://api.digitalocean.com/v2/apps/$APP_ID/deployments"