forked from brennerm/aws-quota-checker
-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (76 loc) · 2.96 KB
/
teleport-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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
on:
pull_request:
branches:
- teleport
push:
branches:
- teleport
tags:
- "*"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
- name: setup Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4
with:
python-version: "3.8"
- name: install
run: pip install .
- name: build package
run: python setup.py bdist_wheel
release:
runs-on: ubuntu-latest
needs: test
if: success() && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
- name: setup Python
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4
with:
python-version: "3.8"
- name: install
run: pip install .[dev]
- name: get changelog entry
id: changelog
run: python tools/extract-changelog-entry.py ${GITHUB_REF#refs/tags/} > changelog_entry
- name: build package
run: python setup.py bdist_wheel
- name: create Release
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: changelog_entry
build_and_push_docker_image:
runs-on: ubuntu-latest
needs: test
name: Build and push Docker image
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
- name: Login to GitHub Container Registry
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Build Docker image
run: docker build . --tag gravitational/aws-quota-checker:latest
- name: Push Docker image for branch
if: ${{ github.ref == 'refs/heads/teleport' && github.event_name == 'push' }}
run: |
docker tag gravitational/aws-quota-checker:latest gravitational/aws-quota-checker:teleport
docker push gravitational/aws-quota-checker:teleport
- name: Push Docker image for branch
if: ${{ github.ref == 'refs/heads/teleport' && github.event_name == 'push' }}
run: |
docker tag gravitational/aws-quota-checker:latest gravitational/aws-quota-checker:teleport
docker push gravitational/aws-quota-checker:teleport
- name: Push Docker image for tag
if: ${{ startsWith(github.ref, 'refs/tags') && github.event_name == 'push' }}
run: |
docker tag gravitational/aws-quota-checker:latest gravitational/aws-quota-checker:${GITHUB_REF##*/}
docker push gravitational/aws-quota-checker:latest
docker push gravitational/aws-quota-checker:${GITHUB_REF##*/}