forked from lambgeo/docker-lambda
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (64 loc) · 2.18 KB
/
ci.yml
File metadata and controls
79 lines (64 loc) · 2.18 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: CI
on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
gdal-version: ['3.8.3']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install boto3 click
- name: Test deploy script
run: |
python scripts/deploy.py 3.8 --help
- name: Test build script
run: |
chmod +x scripts/build.sh
# Test script syntax without actually building
bash -n scripts/build.sh
- name: Test Python runtime Dockerfile syntax
run: |
# Test Dockerfile syntax
docker run --rm -i hadolint/hadolint < dockerfiles/runtimes/python || true
- name: Test main Dockerfile syntax
run: |
# Test Dockerfile syntax
docker run --rm -i hadolint/hadolint < dockerfiles/Dockerfile || true
- name: Build and push Docker images (on push to main)
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: |
echo "Would build and push to ghcr.io/aarondd/lambda-gdal"
# Uncomment and configure when ready to push:
# echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u aarondd --password-stdin
# ./scripts/build.sh 3.8.3 python 3.12
# docker push ghcr.io/aarondd/lambda-gdal:3.8
# docker push ghcr.io/aarondd/lambda-gdal:3.8-python3.12
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
if: always()
with:
sarif_file: 'trivy-results.sarif'