Skip to content

Add Deploy Github Action #8

Add Deploy Github Action

Add Deploy Github Action #8

Workflow file for this run

name: Deploy to S3
on:
push:
branches:
- main # This triggers the workflow on push to the main branch
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20' # Use the Node.js version you need
- name: Install dependencies
run: npm install
- name: Build the Next.js app
run: npm run build
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1 # Change to your AWS region
- name: Sync S3 bucket
run: aws s3 sync ./out s3://jakobheine.de --delete
# --delete flag ensures that files deleted locally are also deleted from the bucket