forked from yahoo/kubectl-flame
-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (117 loc) · 4.58 KB
/
release.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Release
# Controls when the workflow will run
on:
workflow_dispatch:
inputs:
tag:
description: Git tag to build release from
required: true
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
release:
runs-on: [self-hosted, x64, linux, eks, us, general, dev]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.tag }}
- name: Get SHA
id: get-sha
run: echo "::set-output name=sha::$(git log -1 --format='%H')"
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ steps.get-sha.outputs.sha }}
- name: Print Disk Usage
run: |
df -ah
docker buildx du
- name: Setup AWS
uses: ironsource-mobile/github-actions-and-workflows/.github/actions/setup-aws/action.yaml@main
with:
aws_role_arn: arn:aws:iam::032106861074:role/github-runners-devops-team-role
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Set env
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Build JVM Docker Image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{ github.event.repository.name }}
IMAGE_TAG: ${{ github.event.inputs.tag }}
run: |
docker build agent/docker/jvm/Dockerfile -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG-jvm -t $ECR_REGISTRY/$ECR_REPOSITORY:latest
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG-jvm
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
# - name: Build JVM Docker Image
# uses: docker/build-push-action@v1
# with:
# dockerfile: 'agent/docker/jvm/Dockerfile'
# repository: $ECR_REGISTRY/$ECR_REPOSITORY
# tags: ${{ steps.vars.outputs.tag }}-jvm
# env:
# ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
# ECR_REPOSITORY: ${{ github.event.repository.name }}
# IMAGE_TAG: ${{ github.event.inputs.tag }}
# - name: Build JVM Alpine Docker Image
# uses: docker/build-push-action@v1
# with:
# dockerfile: 'agent/docker/jvm/Dockerfile.alpine'
# username: ${{ secrets.DOCKER_HUB_USER }}
# password: ${{ secrets.DOCKER_HUB_PASSWORD }}
# repository: ironsource-mobile/kubectl-flame
# tags: ${{ steps.vars.outputs.tag }}-jvm-alpine
# - name: Build BPF Docker Image
# uses: docker/build-push-action@v1
# with:
# dockerfile: 'agent/docker/bpf/Dockerfile'
# username: ${{ secrets.DOCKER_HUB_USER }}
# password: ${{ secrets.DOCKER_HUB_PASSWORD }}
# repository: ironsource-mobile/kubectl-flame
# tags: ${{ steps.vars.outputs.tag }}-bpf
# - name: Build Python Docker Image
# uses: docker/build-push-action@v1
# with:
# dockerfile: 'agent/docker/python/Dockerfile'
# username: ${{ secrets.DOCKER_HUB_USER }}
# password: ${{ secrets.DOCKER_HUB_PASSWORD }}
# repository: ironsource-mobile/kubectl-flame
# tags: ${{ steps.vars.outputs.tag }}-python
# - name: Build Ruby Docker Image
# uses: docker/build-push-action@v1
# with:
# dockerfile: 'agent/docker/ruby/Dockerfile'
# username: ${{ secrets.DOCKER_HUB_USER }}
# password: ${{ secrets.DOCKER_HUB_PASSWORD }}
# repository: ironsource-mobile/kubectl-flame
# tags: ${{ steps.vars.outputs.tag }}-ruby
# - name: Build perf Docker Image
# uses: docker/build-push-action@v1
# with:
# dockerfile: 'agent/docker/perf/Dockerfile'
# username: ${{ secrets.DOCKER_HUB_USER }}
# password: ${{ secrets.DOCKER_HUB_PASSWORD }}
# repository: ironsource-mobile/kubectl-flame
# tags: ${{ steps.vars.outputs.tag }}-perf
# - name: Setup Go
# uses: actions/setup-go@v1
# with:
# go-version: 1.14
# - name: GoReleaser
# uses: goreleaser/goreleaser-action@v1
# with:
# version: latest
# args: release --rm-dist
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Update new version in krew-index
# uses: rajatjindal/[email protected]