This repository has been archived by the owner on Dec 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 1.56 KB
/
ci.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
50
51
52
53
54
55
56
57
58
59
name: CI
on:
pull_request:
push:
branches: main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install -r requirements.txt
- run: pip install pytest
- run: pytest
artifact:
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v2
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: just dist
- id: artifact
run: |
key=src/record-metrics/${{ github.sha }}.zip
aws s3 cp --acl public-read dist/lambda.zip "s3://infra.restyled.io/$key"
printf 'key=%s\n' "$key" >>"$GITHUB_OUTPUT"
outputs:
key: ${{ steps.artifact.outputs.key }}
deploy:
if: ${{ github.ref == 'refs/heads/main' }}
needs: [test, artifact]
runs-on: ubuntu-latest
steps:
- uses: restyled-io/gitops-deploy-action@main
with:
token: ${{ secrets.GITOPS_ACCESS_TOKEN }}
parameter-name: FunctionSourceKey
parameter-value: ${{ needs.artifact.outputs.key }}
committer-name: Restyled Commits
committer-email: [email protected]
repository: restyled-io/ops
stacks: cg-app/stacks/*/*/mgmt/record-metrics.yaml