Skip to content

[npm backend] (deps-dev): Bump @types/lodash from 4.14.195 to 4.14.19… #1036

[npm backend] (deps-dev): Bump @types/lodash from 4.14.195 to 4.14.19…

[npm backend] (deps-dev): Bump @types/lodash from 4.14.195 to 4.14.19… #1036

name: Deploy backend to Heroku dev environment
on:
pull_request_target: # TODO: remove action on pull request
branches:
- staging
paths:
- "backend/**"
push:
branches: [ main, staging ]
paths:
- "backend/**"
jobs:
deploy:
# If the PR is coming from a fork (pull_request_target), ensure it's opened by "dependabot[bot]"
if: ${{ github.actor == 'dependabot[bot]' || !github.event.pull_request.head.repo.fork }}
runs-on: ubuntu-latest
steps:
- name: Checkout
if: ${{ github.event_name != 'pull_request_target' }}
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout PR
if: ${{ github.event_name == 'pull_request_target' }}
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Set Heroku login credentials
run: |
cat > ~/.netrc <<EOF
machine api.heroku.com
login $HEROKU_EMAIL
password $HEROKU_API_KEY
machine git.heroku.com
login $HEROKU_EMAIL
password $HEROKU_API_KEY
EOF
env:
HEROKU_API_KEY: "${{ secrets.HEROKU_API_KEY }}"
HEROKU_EMAIL: "${{ secrets.HEROKU_EMAIL }}"
- name: Add Heroku git remote
run: heroku git:remote --app $HEROKU_APP_NAME
env:
HEROKU_APP_NAME: "${{ secrets.DEV_PROJECT_ID }}"
- name: Set Heroku config vars
run: |
config() {
heroku config:set "$1"="$2" -a $HEROKU_APP_NAME
}
config MG_DATABASE_URL "${{ secrets.DEV_MG_DATABASE_URL }}"
config FIREBASE_WEB_API_KEY "${{ secrets.DEV_FIREBASE_WEB_API_KEY }}"
config FIREBASE_STORAGE_DEFAULT_BUCKET "${{ secrets.DEV_FIREBASE_STORAGE_DEFAULT_BUCKET }}"
config FIREBASE_PROJECT_ID "${{ secrets.DEV_PROJECT_ID }}"
config FIREBASE_SVC_ACCOUNT_PRIVATE_KEY "${{ secrets.DEV_FIREBASE_SVC_ACCOUNT_PRIVATE_KEY }}"
config FIREBASE_SVC_ACCOUNT_CLIENT_EMAIL "${{ secrets.DEV_FIREBASE_SVC_ACCOUNT_CLIENT_EMAIL }}"
config MAILER_USER "${{ secrets.DEV_MAILER_USER }}"
config MAILER_CLIENT_ID "${{ secrets.DEV_MAILER_CLIENT_ID }}"
config MAILER_CLIENT_SECRET "${{ secrets.DEV_MAILER_CLIENT_SECRET }}"
config MAILER_REFRESH_TOKEN "${{ secrets.DEV_MAILER_REFRESH_TOKEN }}"
config PREVIEW_DEPLOY true
env:
HEROKU_APP_NAME: "${{ secrets.DEV_PROJECT_ID }}"
- name: Push to Heroku
run: git push heroku `git subtree split --prefix backend`:main --force