From 3217610a55a1f2b9ebef5db9da2f729729be1c7d Mon Sep 17 00:00:00 2001 From: Aran Leite Date: Fri, 5 Jan 2024 13:34:50 -0300 Subject: [PATCH] Enable CD to Amazon S3 --- .github/workflows/cd.yml | 41 ++++++++++++++++++++++++++++++++++++++++ next.config.js | 8 -------- 2 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..119e9dd --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,41 @@ +name: deploy static website to AWS-S3 + +on: + push: + branches: + - "main" + workflow_dispatch: +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: 🏗 Checkout repo + uses: actions/checkout@v3 + + - name: 🏗 Enable PNPM + uses: pnpm/action-setup@v2 + with: + version: "latest" + + - name: 🏗 Setup Node.js environment + uses: actions/setup-node@main + with: + node-version: "lts/*" + cache: "pnpm" + + - name: 📦 Install dependencies + run: pnpm i + + - name: 🚀 Build the app + run: pnpm build + + - name: Set up AWS CLI + uses: aws-actions/configure-aws-credentials@v1 + with: + 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 AWS S3 + run: aws s3 sync ./out s3://maple-sim --delete diff --git a/next.config.js b/next.config.js index 12e247b..6f5b312 100644 --- a/next.config.js +++ b/next.config.js @@ -16,14 +16,6 @@ module.exports = async (phase, { defaultConfig }) => { }, }, }, - images: { - remotePatterns: [ - { - hostname: "d1jarb7xa67pb9.cloudfront.net", - protocol: "https", - }, - ], - }, output: "export", productionBrowserSourceMaps: true, reactStrictMode: true,