Update dependency next-auth to v4.24.4 #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy on prod | |
env: | |
NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }} | |
NEXT_PUBLIC_URL: ${{ secrets.NEXT_PUBLIC_URL }} | |
NEXT_PUBLIC_URL_ALT: ${{ secrets.NEXT_PUBLIC_URL_ALT }} | |
NEXT_PUBLIC_API_TOKEN: ${{ secrets.NEXT_PUBLIC_API_TOKEN }} | |
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }} | |
NEXTAUTH_URL: ${{ secrets.NEXTAUTH_URL }} | |
NODE_ENV: ${{ secrets.NODE_ENV }} | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Use Node.js 20.x | |
uses: actions/setup-node@v3 | |
with: | |
cache: 'npm' | |
node-version: 20.x | |
- name: Install dependencies in production | |
run: npm ci --ignore-scripts | |
- name: Build the app | |
continue-on-error: false | |
run: npm run build | |
- name: List files | |
run: ls -la | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: ${{ secrets.APP_IMAGE }} | |
build-args: NEXT_PUBLIC_API_URL=${{ secrets.NEXT_PUBLIC_API_URL }} | |
NEXT_PUBLIC_URL=${{ secrets.NEXT_PUBLIC_URL }} | |
NEXT_PUBLIC_URL_ALT=${{ secrets.NEXT_PUBLIC_URL_ALT }} | |
- name: Deploy on cap rover | |
run: docker run caprover/cli-caprover:latest caprover deploy --caproverUrl "${{ secrets.APP_URL }}" --appToken "${{ secrets.APP_TOKEN }}" --caproverApp "${{ secrets.APP_NAME }}" --imageName "${{ secrets.APP_IMAGE }}" |