Skip to content

Commit

Permalink
feat: port serverless function to lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
Princesseuh committed Nov 16, 2024
1 parent 5b0f26b commit 33be5d1
Show file tree
Hide file tree
Showing 24 changed files with 401 additions and 793 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/deploy-lambda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Deploy API

on:
push:
paths:
- api/**
- content/games/**
- content/movies/**
- content/shows/**
- content/books/**

env:
ONLY_SEED: true

jobs:
lint:
name: Lint Rust functions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Clippy
run: cargo clippy

deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup PNPM
uses: pnpm/action-setup@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"

- name: Build website
run: pnpm build

- name: Setup Rust
uses: moonrepo/setup-rust@v1
with:
bins: cargo-lambda
targets: aarch64-unknown-linux-gnu

- name: Build
run: cargo lambda build --arm64 --release

- name: Deploy
run: cargo lambda deploy --include ./api/cataloguedb.db
env:
AWS_DEFAULT_REGION: eu-north-1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,5 @@ apps/erika.florist/src/pages/test.astro
.astro
.env
.vercel
api/catalogue/cataloguedb.db

.cargo/config.toml
.cargo/_config.toml
api/cataloguedb.db
api/cataloguedb.db-journal
3 changes: 0 additions & 3 deletions .npmrc

This file was deleted.

Loading

0 comments on commit 33be5d1

Please sign in to comment.