Skip to content

Commit

Permalink
Create main.yml for CI/CD with GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Peco1503 authored Jun 10, 2024
1 parent dbc8a65 commit f136b38
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
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

- 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 }}

0 comments on commit f136b38

Please sign in to comment.