-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: port serverless function to lambda
- Loading branch information
1 parent
5b0f26b
commit 33be5d1
Showing
24 changed files
with
401 additions
and
793 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.