Skip to content

Commit 927471a

Browse files
committed
feat: publish layer using github actions
1 parent 4a3a64a commit 927471a

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/build.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
pull_request:
6+
release:
7+
types: [published]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
container: amazonlinux:2
17+
steps:
18+
- name: Install the necessary tools
19+
run: |
20+
yum update -y
21+
yum groupinstall "Development Tools" -y
22+
yum install -y tar wget
23+
24+
- name: Download MuPDF
25+
run: |
26+
wget https://mupdf.com/downloads/archive/mupdf-1.19.0-source.tar.xz
27+
tar -xf mupdf-1.19.0-source.tar.xz
28+
cd mupdf-1.19.0-source
29+
30+
- name: Build MuPDF
31+
run: |
32+
make build=release
33+
34+
- name: Create the layer
35+
run: |
36+
mkdir -p layer/bin
37+
cp build/release/mutool layer/bin/
38+
cd layer
39+
zip -r9 ../mutool-layer.zip .
40+
cd ..
41+
42+
- name: Upload the layer to the github artifact
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: mutool-layer
46+
path: mutool-layer.zip
47+
48+
- name: Login to AWS
49+
run: |
50+
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
51+
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
52+
aws configure set region ${{ secrets.AWS_REGION }}
53+
54+
- name: Deploy the layer to the artifact registry
55+
run: |
56+
aws lambda publish-layer-version \
57+
--layer-name mutool-layer \
58+
--zip-file fileb://mutool-layer.zip \
59+
--compatible-runtimes nodejs20.x
60+
--region ${{ secrets.AWS_REGION }}

0 commit comments

Comments
 (0)