Skip to content

Commit

Permalink
revert: remover pipeline de deploy no github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasCBV committed May 18, 2024
1 parent 850fc07 commit 67f0c17
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 85 deletions.
85 changes: 0 additions & 85 deletions .github/workflows/deploy-functions.yml

This file was deleted.

10 changes: 10 additions & 0 deletions build-project.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
INFO_FLAG="[INFO]"

echo "${INFO_FLAG} Install pnpm"
npm install pnpm -g

echo "${INFO_FLAG} Installing dependencies"
pnpm install

echo "${INFO_FLAG} Building project"
pnpm run build
33 changes: 33 additions & 0 deletions push-to-storage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
INFO_FLAG="[INFO]"
TIME=$(date +%y%m%d%H%M%S%N)
FUNCTION_NAME=$1
FUNCTION_ID=$2

echo "${INFO_FLAG} Zipping dist folder"
mkdir ./"build-${TIME}"
cp -r ./dist/functions ./"build-${TIME}"
mv ./"build-${TIME}"/**/* ./"build-${TIME}"
rmdir ./"build-${TIME}"/functions

cd ./"build-${TIME}"

cp ../package.json .
cp ../pnpm-lock.yaml .

sed -i 's/dist\/functions\/index.js/index.js/' ./package.json
sed '8d' ./package.json >> ./package.tmp.json
rm ./package.json
mv ./package.tmp.json ./package.json

zip -r ./"${FUNCTION_NAME}".zip ./*

mkdir ./"${FUNCTION_NAME}-${FUNCTION_ID}"
mv ./"${FUNCTION_NAME}".zip ./"${FUNCTION_NAME}-${FUNCTION_ID}"

echo "${INFO_FLAG} Uploading zip file to ${BUCKET_PATH}"
gsutil -m cp -r ./"${FUNCTION_NAME}-${FUNCTION_ID}" ${BUCKET_PATH}

echo "${INFO_FLAG} Cleaning build dir"
cd ../
rm -rf ./"build-${TIME}"

0 comments on commit 67f0c17

Please sign in to comment.