Skip to content

Commit

Permalink
Merge pull request #2 from Guysnacho/automate-apply
Browse files Browse the repository at this point in the history
Automate-applies
  • Loading branch information
Guysnacho authored Jul 16, 2024
2 parents f545707 + bf63bde commit 8afe0d8
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
61 changes: 61 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
on:
push:
branches: ["main"]
permissions:
pull-requests: write
name: 🌱 Apply, Build, Deploy
jobs:
TF-SignIn:
name: Terraform Sign-in 🗝️
runs-on: ubuntu-latest
env:
tf_actions_working_dir: "terraform"
defaults:
run:
working-directory: ${{ env.tf_actions_working_dir }}
steps:
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
terraform_version: 1.9.2
- run: terraform init
apply-infra:
name: 🎉 Deploy
runs-on: ubuntu-latest
needs: ["TF-SignIn"]
steps:
- name: Check Out
uses: actions/checkout@v4
- name: 🏗️ Terraform Apply
run: |
cd terraform
terraform plan -no-color
- run: echo ${{ steps.plan.outputs.stdout }}
- run: echo ${{ steps.plan.outputs.stderr }}
- run: echo ${{ steps.plan.outputs.exitcode }}
web-deploy:
name: 🎉 Deploy
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
needs: ["apply-infra"]
defaults:
run:
working-directory: "web"
steps:
- name: Use Node.js
uses: actions/setup-node@v4
with:
cache: "npm"
- name: 🔨 Build Project
run: |
npm install
npm run build
- name: 🚀 Upload Package
uses: reggionick/s3-deploy@v4
with:
folder: out
bucket: ${{ secrets.S3_BUCKET }}
bucket-region: us-west-2
5 changes: 4 additions & 1 deletion web/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
output: 'export',
output: "export",
images: {
unoptimized: true,
},
};

export default nextConfig;

0 comments on commit 8afe0d8

Please sign in to comment.