forked from alphagov/di-devplatform-upload-action-ecr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yaml
More file actions
63 lines (54 loc) · 2.12 KB
/
Copy pathaction.yaml
File metadata and controls
63 lines (54 loc) · 2.12 KB
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
name: "Upload Containers to ECR, update references in CF templates"
description: "Packages and uploads, replaces reference in (eg) template.yaml"
inputs:
role-to-assume-arn:
description: "The secret with the ARN of the role to assume (required) eg secrets.GH_ACTIONS_ROLE_ARN"
required: true
container-sign-kms-key-arn:
description: "The secret with the ARN of the key to sign container images e.g. secrets.CONTAINER_SIGN_KMS_KEY"
required: true
template-file:
description: "The name of the CF template for the application. This defaults to template.yaml"
required: false
default: template.yaml
working-directory:
description: "The working directory containing the app"
required: false
artifact-bucket-name:
description: "The secret with the name of the artifact S3 bucket (required) eg secrets.ARTIFACT_SOURCE_BUCKET_NAME"
required: true
ecr-repo-name:
description: "The secret with the name of the ECR Repo (required) eg secrets.ECR_REPOSITORY"
required: true
runs:
using: "composite"
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Set up AWS creds
uses: aws-actions/configure-aws-credentials@v1-node16
with:
role-to-assume: ${{ inputs.role-to-assume-arn }}
aws-region: eu-west-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Install Cosign
uses: sigstore/cosign-installer@main
with:
cosign-release: 'v1.9.0'
- name: Upload Fargates to S3
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
CONTAINER_SIGN_KMS_KEY_ARN: ${{ inputs.container-sign-kms-key-arn }}
GITHUB_SHA: ${{ github.sha }}
WORKING_DIRECTORY: ${{ inputs.working-directory }}
TEMPLATE_FILE: ${{ inputs.template-file }}
ECR_REPO_NAME: ${{ inputs.ecr-repo-name }}
ARTIFACT_BUCKET_NAME: ${{ inputs.artifact-bucket-name }}
run: ${{ github.action_path }}/scripts/build-tag-push-ecr.sh
shell: bash