Skip to content

Changed Resend Domain #4

Changed Resend Domain

Changed Resend Domain #4

Workflow file for this run

name: πŸš€ Deploy
on:
push:
branches:
- main
- dev
pull_request: {}
permissions:
actions: write
contents: read
jobs:
build:
name: 🐳 build
uses: ./.github/workflows/build.yml
secrets: inherit
deploy:
name: πŸš€ Deploy
runs-on: [self-hosted]
needs: [build]
# needs: [build]
# only build/deploy main branch on pushes
if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }}
env:
JWT_SECRET: ${{ secrets.JWT_SECRET }}
PORT: ${{ secrets.PORT }}
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}
FRONTEND_URL: ${{ secrets.FRONTEND_URL }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET: ${{ secrets.AWS_SECRET }}
AWS_BUCKET_NAME: ${{ secrets.AWS_BUCKET_NAME }}
AWS_REGION: ${{ secrets.AWS_REGION }}
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }}
STRIPE_WEBHOOK_SECRET: ${{ secrets.STRIPE_WEBHOOK_SECRET }}
steps:
- name: Cache node modules
uses: actions/[email protected]
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: ⬇️ Checkout repo
uses: actions/[email protected]
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: πŸš€ Run Docker Compose on Staging
# if: ${{ github.ref == 'refs/heads/dev' }}
# env:
# DATABASE_URL: ${{ secrets.DATABASE_URL_STAGING }}
# FRONTEND_URL: ${{ secrets.FRONTEND_URL_STAGING }}
# run: |
# docker pull algomax/nestjs-chat-api:latest
# docker compose -f docker-compose.dev.yaml up -d
# docker system prune --all --volumes --force
- name: πŸš€ Run Docker Compose on Production
if: ${{ github.ref == 'refs/heads/main' }}
# env:
# FRONTEND_URL: ${{ secrets.FRONTEND_URL }}
# DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: |
docker pull algomax/nestjs-chat-api:production
docker compose -f docker-compose.prod.yaml up -d
docker system prune --all --volumes --force