Skip to content

Commit

Permalink
Cleaner deployment tag code
Browse files Browse the repository at this point in the history
  • Loading branch information
devinmatte committed Jun 7, 2024
1 parent 441045e commit 53764e0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 0 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-tags: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
Expand Down
14 changes: 14 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@ export AWS_DEFAULT_REGION=us-east-1
export AWS_PAGER=""

PRODUCTION=false
CI=false

# Argument parsing
# pass "-p" flag to deploy to production
# pass "-c" flag if deploying with CI

while getopts "pc" opt; do
case $opt in
p)
PRODUCTION=true
;;
c)
CI=true
;;
esac
done

Expand Down Expand Up @@ -44,6 +49,15 @@ if [[ -z "$DD_API_KEY" ]]; then
exit 1
fi

# Fetch repository tags
# Run unshallow if deploying in CI

if $CI; then
git fetch --unshallow --tags
else
git fetch --tags
fi

# Identify the version and commit of the current deploy
GIT_VERSION=`git describe --tags --always`
GIT_SHA=`git rev-parse HEAD`
Expand Down

0 comments on commit 53764e0

Please sign in to comment.