Skip to content

Setup, Build, and Publish #129

Setup, Build, and Publish

Setup, Build, and Publish #129

Workflow file for this run

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