-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
55 lines (52 loc) · 1.7 KB
/
action.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
name: 'Build and push Docker image'
description: 'Workflow to build and push Docker image to AWS ECR'
inputs:
aws-access-key-id:
description: 'AWS Access Key ID'
required: true
aws-secret-access-key:
description: 'AWS Secret Access Key'
required: true
aws-ecr-registry:
description: 'AWS ECR registry'
required: true
debitoor-npm-token:
description: 'NPM token for @debitoor scoped packages'
required: true
sumup-npm-token:
description: 'NPM token for @sumup scoped packages'
required: false
gh-ssh-private-key-b64:
description: 'Base64 encoded GH private key'
required: true
dockerfilePath:
description: Path to Dockerfile if different than root
required: false
runs:
using: "composite"
steps:
- uses: actions/checkout@v3
- name: Login to AWS ECR Registry
uses: docker/#-action@v1
with:
username: ${{ inputs.aws-access-key-id }}
password: ${{ inputs.aws-secret-access-key }}
registry: ${{ inputs.aws-ecr-registry }}
- name: Build and push
env:
ECR_REPOSITORY: ${{ github.event.repository.name }} # NOTE: this is not populated for scheduled jobs
DEBITOOR_NPM_TOKEN: ${{ inputs.debitoor-npm-token }}
SUMUP_NPM_TOKEN: ${{ inputs.sumup-npm-token }}
ssh_prv_key: ${{ inputs.gh-ssh-private-key-b64 }}
uses: docker/build-push-action@v2
with:
push: true
file: ${{ inputs.dockerfilePath }}
build-args: |
DEBITOOR_NPM_TOKEN
SUMUP_NPM_TOKEN
ssh_prv_key
tags: ${{ inputs.aws-ecr-registry }}/${{ env.ECR_REPOSITORY }}:latest
- name: List Docker images
run: docker images
shell: bash