-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (78 loc) · 2.12 KB
/
ci.yaml
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
80
81
82
name: ci
on:
push:
branches:
- '*'
tags:
- 'v*'
pull_request:
branches:
- 'main'
jobs:
docker:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
-
name: Checkout
uses: actions/checkout@v3
-
uses: actions/setup-python@v4
with:
python-version: "3.9"
-
name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
-
name: Build EE context with Docker
env:
DOCKER_BUILDKIT: 1
run: |
tox -e docker
-
name: Configure AWS credentials by OIDC
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::343598423625:role/ugns-gbl-github-actions
role-duration-seconds: 1200
aws-region: us-east-1
-
name: Assume IAM Role
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
aws-session-token: ${{ env.AWS_SESSION_TOKEN }}
role-to-assume: arn:aws:iam::804433379618:role/GitHubActionsExecution
role-skip-session-tagging: true
role-duration-seconds: 1200
aws-region: us-east-1
-
name: Login to Public ECR
uses: docker/login-action@v2
with:
registry: public.ecr.aws
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
public.ecr.aws/undergrid/awx-custom-ee
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
-
name: Build and push
uses: docker/build-push-action@v4
with:
context: context
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}