Skip to content

Commit

Permalink
feat: github lambda builds
Browse files Browse the repository at this point in the history
  • Loading branch information
roleyfoley committed Dec 7, 2020
1 parent 01c1bc8 commit c33e44e
Show file tree
Hide file tree
Showing 3 changed files with 2,273 additions and 629 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
on:
push:
tags:
- 'v*'

name: Create Lambda Release Artefacts

jobs:
build:
name: Create Lambda Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install brew packages
run: sudo apt-get install build-essential curl file git

- name: Install homebrew
run: |
git clone https://github.com/Homebrew/brew ~/.linuxbrew/Homebrew
mkdir ~/.linuxbrew/bin
ln -s ~/.linuxbrew/Homebrew/bin/brew ~/.linuxbrew/bin
eval $(~/.linuxbrew/bin/brew shellenv)
- name: Install sam
run: |
brew tap aws/tap
brew install aws-sam-cli
- name: Build project
run: |
npm ci
npm run-script build
sam build --use-container
- name: Zip images
working-directory: .aws-sam/build
run: |
readarray -t lambda_dirs <<< "$(find . -maxdepth 1 -mindepth 1 -type d)"
for dir in "${lambda_dirs[@]}"; do
export dir="${dir}"
( cd "${dir}" && zip -r "../${dir/'./'/''}" ./ )
done
- name: Create Tag Release
id: create_tag_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Tag Release Asset
id: upload_tag_release_asset
uses: AButler/upload-release-assets@v2.0
with:
files: '.aws-sam/build/*.zip'
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ github.ref }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,4 @@ build
CD.sh
PUB.sh
CREATE.sh
tsconfig.tsbuildinfo
tsconfig.tsbuildinfo

0 comments on commit c33e44e

Please sign in to comment.