Skip to content

Commit

Permalink
merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Peco1503 committed Jun 11, 2024
2 parents 53311cf + cfb52d6 commit b286eb8
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy to AWS Amplify

on:
push:
branches:
- main
paths-ignore:
- '**.md'

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

- name: Install AWS Amplify CLI
run: npm install -g @aws-amplify/cli

- name: Initialize Amplify
run: |
amplify init --amplify "{ \"envName\": \"prod\" }" --yes
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1'

- name: Deploy to Amplify
run: amplify publish
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
27 changes: 27 additions & 0 deletions amplify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: 1
frontend:
phases:
preBuild:
commands:
- npm ci --cache .npm --prefer-offline
build:
commands:
- npm run build
- echo "NEXTAUTH_SECRET=$NEXTAUTH_SECRET" >> .env
- echo "NEXTAUTH_URL=$NEXTAUTH_URL" >> .env
- echo "JWT_SECRET=$JWT_SECRET" >> .env
- echo "DATABASE_URL=$DATABASE_URL" >> .env
- echo "OPENAI_API_KEY=$OPENAI_API_KEY" >> .env
- echo "GOOGLE_CLIENT_ID=$GOOGLE_CLIENT_ID" >> .env
- echo "GOOGLE_CLIENT_SECRET=$GOOGLE_CLIENT_SECRET" >> .env
- echo "LINKEDIN_CLIENT_ID=$LINKEDIN_CLIENT_ID" >> .env
- echo "LINKEDIN_CLIENT_SECRET=$LINKEDIN_CLIENT_SECRET" >> .env
- echo "NEXT_PUBLIC_TINYMCE_API_KEY=$NEXT_PUBLIC_TINYMCE_API_KEY" >> .env
artifacts:
baseDirectory: .next
files:
- '**/*'
cache:
paths:
- .next/cache/**/*
- .npm/**/*

0 comments on commit b286eb8

Please sign in to comment.