Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/deploy-group3-notice-board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Deploy Group3 Notice Board

on:
push:
branches: [master]
paths:
- "workshops/fullstack-aws/projects/Group3_DavidWilber_Dea_Jaime_Adarash_GroupOfThreePlusOne/02-notice-board/**"
- ".github/workflows/deploy-group3-notice-board.yml"
workflow_dispatch: {}

permissions:
contents: read

concurrency:
group: group3-notice-board-production
cancel-in-progress: true

env:
PROJECT_DIR: workshops/fullstack-aws/projects/Group3_DavidWilber_Dea_Jaime_Adarash_GroupOfThreePlusOne/02-notice-board

jobs:
deploy:
if: github.repository == 'WilberD321/ToDel_workshops'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.12'

- uses: actions/setup-node@v4
with:
node-version: 20

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Build Lambda package
working-directory: ${{ env.PROJECT_DIR }}
run: python build.py

- name: Deploy backend
working-directory: ${{ env.PROJECT_DIR }}
run: |
aws lambda update-function-code \
--function-name "${{ secrets.LAMBDA_FUNCTION_NAME }}" \
--zip-file fileb://backend/lambda.zip

- name: Install frontend dependencies
working-directory: ${{ env.PROJECT_DIR }}/frontend
run: npm install

- name: Build frontend
working-directory: ${{ env.PROJECT_DIR }}/frontend
env:
VITE_API_URL: ${{ secrets.VITE_API_URL }}
run: npm run build

- name: Deploy frontend
working-directory: ${{ env.PROJECT_DIR }}/frontend
run: aws s3 sync dist/ "s3://${{ secrets.S3_BUCKET }}/" --delete
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
node_modules/
dist/
*.zip
backend/_build/
.terraform/
.terraform.lock.hcl
terraform.tfstate
terraform.tfstate.backup
terraform.tfvars
.env
__pycache__/
venv/

Loading