Skip to content

Commit

Permalink
Only cd to cloned repo path in AWS if not already in said dir
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Pow committed Jun 18, 2024
1 parent 84ae092 commit 88f7366
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/actions/deploy-aws/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,6 @@ runs:
# which would make the repository URL less hard-coded.
# To do so, don't forget to also change the implementation of `index.sh deployAws`.
run: |
ls -FlAh .
ls -FlAh anime-atsume
./index.sh deployAws \
-u "${{ env.AWS_SSH_USERNAME }}" \
-h "${{ env.AWS_INSTANCE_URL }}" \
Expand Down
16 changes: 9 additions & 7 deletions index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -676,13 +676,15 @@ deployServerSsh() (
# Allows for background/foreground job control, e.g. bg, fg, jobs -l, etc.
set -m
[[ -d anime-atsume ]] && rm -rf anime-atsume
git clone https://github.com/${repoPath}.git
# Stay in the cloned repo's dir to gain access to our helpful index.sh commands.
# Note: This means the server's volume mounted to Docker needs to be relative
# to the repo dir, not the \`WORKDIR\` or \`HOME\`.
cd anime-atsume
if ! [[ -f ./index.sh ]]; then
[[ -d anime-atsume ]] && rm -rf anime-atsume
git clone https://github.com/${repoPath}.git
# Stay in the cloned repo's dir to gain access to our helpful index.sh commands.
# Note: This means the server's volume mounted to Docker needs to be relative
# to the repo dir, not the \`WORKDIR\` or \`HOME\`.
cd anime-atsume
fi
./index.sh dockerStopAllContainers
./index.sh dockerDeleteAllContainers
Expand Down

0 comments on commit 88f7366

Please sign in to comment.