Some checks failed
Deploy FitLien services to Dev / Deploy to Dev (push) Failing after 1m24s
68 lines
2.7 KiB
YAML
68 lines
2.7 KiB
YAML
name: Deploy FitLien services to Dev
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
jobs:
|
|
deploy:
|
|
name: Deploy to Dev
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Copy .env.example to .env
|
|
run: cp functions/.env.example functions/.env
|
|
|
|
- name: Create private key file
|
|
run: |
|
|
mkdir -p functions/assets/keys
|
|
echo "${{ secrets.FITLIEN_PRIVATEKEY_DEV }}" > functions/assets/keys/fitLien_private.pem
|
|
chmod 600 functions/assets/keys/fitLien_private.pem
|
|
|
|
- name: Replace variables in .env
|
|
run: |
|
|
sed -i "s/#{TWILIO_ACCOUNT_SID}#/${{ secrets.TWILIO_ACCOUNT_SID }}/" functions/.env
|
|
sed -i "s/#{TWILIO_AUTH_TOKEN}#/${{ secrets.TWILIO_AUTH_TOKEN }}/" functions/.env
|
|
sed -i "s/#{TWILIO_PHONE_NUMBER}#/${{ secrets.TWILIO_PHONE_NUMBER }}/" functions/.env
|
|
sed -i "s/#{SERVICES_RGN}#/${{ vars.SERVICES_RGN }}/" functions/.env
|
|
sed -i "s/#{GOOGLE_MAPS_API_KEY}#/${{ secrets.GOOGLE_MAPS_API_KEY }}/" functions/.env
|
|
sed -i "s/#{SES_FROM_EMAIL}#/${{ vars.SES_FROM_EMAIL }}/" functions/.env
|
|
sed -i "s/#{SES_REPLY_TO_EMAIL}#/${{ vars.SES_REPLY_TO_EMAIL }}/" functions/.env
|
|
sed -i "s/#{AWS_ACCESS_KEY_ID}#/${{ secrets.AWS_ACCESS_KEY_ID }}/" functions/.env
|
|
sed -i "s/#{AWS_SECRET_ACCESS_KEY}#/${{ secrets.AWS_SECRET_ACCESS_KEY }}/" functions/.env
|
|
sed -i "s/#{AWS_REGION}#/${{ secrets.AWS_REGION }}/" functions/.env
|
|
sed -i "s/#{PHONEPE_CLIENT_ID}#/${{ secrets.PHONEPE_CLIENT_ID }}/" functions/.env
|
|
sed -i "s/#{PHONEPE_CLIENT_SECRET}#/${{ secrets.PHONEPE_CLIENT_SECRET }}/" functions/.env
|
|
sed -i "s/#{PHONEPE_API_URL}#/${{ secrets.PHONEPE_API_URL }}/" functions/.env
|
|
sed -i "s/#{PHONEPE_WEBHOOK_USERNAME}#/${{ secrets.PHONEPE_WEBHOOK_USERNAME }}/" functions/.env
|
|
sed -i "s/#{PHONEPE_WEBHOOK_PASSWORD}#/${{ secrets.PHONEPE_WEBHOOK_PASSWORD }}/" functions/.env
|
|
|
|
cat functions/.env
|
|
- name: "Replace #{SERVICES_RGN}# in all .ts files"
|
|
run: |
|
|
find . -type f -name "*.ts" -exec sed -i "s/#{SERVICES_RGN}#/${{ vars.SERVICES_RGN }}/g" {} +
|
|
|
|
- name: Build
|
|
run: |
|
|
npm install -g typescript
|
|
cd functions
|
|
npm install
|
|
npx tsc
|
|
cd ..
|
|
ls -la
|
|
|
|
- name: Deploy
|
|
run: |
|
|
curl -sL firebase.tools | upgrade=true bash
|
|
firebase use --token ${{ secrets.FIREBASE_TOKEN }} debug
|
|
firebase deploy --token "${{ secrets.FIREBASE_TOKEN }}" --force --non-interactive
|