Skip to content

Commit

Permalink
ci: last try, I promise
Browse files Browse the repository at this point in the history
Signed-off-by: Fery Wardiyanto <[email protected]>
  • Loading branch information
feryardiant committed Apr 1, 2024
1 parent 22a8696 commit dc3f161
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ jobs:
[[ ! -d $HOME/.ssh ]] && mkdir $HOME/.ssh
echo "$SSH_RSAKEY" >> $HOME/.ssh/id_rsa
echo "$SSH_CONFIG" >> $HOME/.ssh/config
chmod 600 $HOME/.ssh/* && ls -lah $HOME/.ssh/
git config user.name "Creasi.HQ" && git config user.email "[email protected]"
chmod 600 $HOME/.ssh/*
- name: Deploy
run: |
git config --global user.name "Creasi.HQ" && git config --global user.email "[email protected]"
git clone creasi.co:~/git/creasico-skeleton.git storage/deploy-tmp
./scripts/deploy.sh ${{ env.APP_ENV }}
Expand Down
12 changes: 6 additions & 6 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@ branch="${modes[$1]}"

echo "building ${mode} for ${branch}"

pnpm build --mode $mode
if command -v pnpm &> /dev/null; then
pnpm build --mode $mode
fi

find $tmp_dir -depth 1 ! -name .git ! -name $tmp_dir -exec rm -rf {} +

git archive --format tar --prefix deploy-tmp/ HEAD | (cd storage && tar xf -)

rm -rf $tmp_dir/public/{.gitignore,build}

rsync -av --exclude='*.map' public/build $tmp_dir/public/

cd $tmp_dir

if [[ -f public/.gitignore ]]; then
rm public/.gitignore
fi

git checkout $branch --force
git add -A && git commit -sm "chore: update $(date +'%Y-%m-%d')"
git add -A && git commit -sm "chore: update $(date +'%Y-%m-%d %H:%M')"
git push origin -u $branch:$branch

cd -

0 comments on commit dc3f161

Please sign in to comment.