-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
76 lines (70 loc) · 2.4 KB
/
action.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
name: 'Go lang pipeline'
description: 'Go Lang Docker Build, AWS ECR Push and Kustomize step'
inputs:
app-name:
description: 'The app name'
required: true
aws-region:
description: 'AWS region name to assume role'
required: true
github-deploy-ssh-key:
description: 'The github deploy SSH key to clone K8S manifests'
required: true
github-token:
description: 'The github token to create PR'
required: true
go-version:
description: 'Go lang version'
required: true
default: 1.16
k8s-manifest-repo-name:
description: 'The name of K8S manifests repository'
required: true
k8s-manifest-repo-ssh:
description: 'The SSH of K8S manifests repository'
required: true
role-session-name:
description: 'The AWS Session name'
required: true
role-to-assume:
description: 'The AWS OICD role to assume'
required: true
runs:
using: "composite"
steps:
- name: Get git repository informations
uses: ferr3ira-gabriel/github-actions-git-informations@master
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ inputs.go-version }}
- name: Configure AWS credentials from AWS account
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ inputs.role-to-assume }}
aws-region: ${{ inputs.aws-region }}
role-session-name: ${{ inputs.role-session-name }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
mask-password: 'true'
- name: Build, tag, and push docker image to Amazon ECR
shell: bash
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: ${{ inputs.app-name }}
IMAGE_TAG: ${{ env.RELEASE_VERSION }}
run: |
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG .
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
- name: Kustomize step
uses: ferr3ira-gabriel/github-actions-kustomize-argocd-manifests@master
with:
app-name: ${{ inputs.app-name }}
app-registry: ${{ steps.login-ecr.outputs.registry }}
github-actor: ${{ github.actor }}
github-deploy-ssh-key: '${{ inputs.github-deploy-ssh-key }}'
github-token: '${{ inputs.github-token }}'
k8s-manifest-repo-name: '${{ inputs.k8s-manifest-repo-name }}'
k8s-manifest-repo-ssh: '${{ inputs.k8s-manifest-repo-ssh }}'