-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (41 loc) · 1.56 KB
/
main.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
name: Python CI Pipeline
on:
workflow_dispatch
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
test-and-build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Run Linting
run: |
echo "Running Linter"
# Placeholder for lint tool command
- name: Run Tests
run: |
echo "Running tests"
# Placeholder for test execution command
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-1
# Package and publish app to build repository. Here S3 is used as the build repository as an example.
- name: Package and publish app to build repository
run: |
echo "Publishing application to build repository..."
build_version=$(head -n 1 version)
repository_type=snapshots
if [["$BRANCH_NAME]}" == 'main' || "$BRANCH_NAME" == release/* ]]; then
repository_type=releases
fi
echo "Branch is $BRANCH_NAME, so uploading build to $repository_type repository"
zip python-app-$build_version.zip lambda-s3-dynamodb.py
aws s3 cp python-app-$build_version.zip s3://vw-demo-730335502100-build-repository/$repository_type/