-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (49 loc) · 1.72 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Setup, Build, and Publish
on:
workflow_dispatch:
push:
tags:
- '*'
jobs:
setup-build-and-publish:
name: Setup, Build, and Publish
runs-on: ubuntu-latest
steps:
- name: Checkout # the code
uses: actions/checkout@v4
- name: Cache # cargo and targets
uses: swatinem/rust-cache@v2
- name: Install # missing packages
run: sudo apt-get update --yes && sudo apt-get install --yes musl-tools
- name: Setup # the secrets
run: |
mkdir -p secrets
echo ${{ secrets.SVE_CREDENTIALS_ENCODED }} | base64 -d > secrets/credentials.json
echo ${{ secrets.SVE_EMAILS_ENCODED }} | base64 -d > secrets/email.json
echo ${{ secrets.SVE_DB_ENCODED }} | base64 -d > secrets/database_url.env
- name: Build # the binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: "build"
target: aarch64-unknown-linux-musl
args: "--release --locked"
- name: Test # the binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: "test"
target: aarch64-unknown-linux-musl
args: "--release --locked"
- name: Package # the binary
run: |
cd target/aarch64-unknown-linux-musl/release
mv sve_backend bootstrap
7z a lambda.zip bootstrap
mv lambda.zip ../../../
- name: Publish # to aws
uses: appleboy/[email protected]
with:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_region: ${{ secrets.AWS_REGION }}
function_name: sve-backend
zip_file: lambda.zip