-
Notifications
You must be signed in to change notification settings - Fork 7
32 lines (32 loc) · 1.42 KB
/
publish-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
name: publish-image
on:
push:
tags: '*'
jobs:
publish-tagged-image:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v2
- name: Assume role
uses: aws-actions/configure-aws-credentials@master
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions
role-session-name: GitHubActions-${{ github.run_id }}
- name: Build, tag, and push default image to Amazon ECR
run: |
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/s5e9c0e3
cd default
docker build -t ci:${{ github.ref_name }} .
docker tag ci:${{ github.ref_name }} public.ecr.aws/s5e9c0e3/ci:${{ github.ref_name }}
docker push public.ecr.aws/s5e9c0e3/ci:${{ github.ref_name }}
- name: Build, tag, and push serverless image to Amazon ECR
run: |
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/s5e9c0e3
cd serverless
docker build -t ci:${{ github.ref_name }}-serverless .
docker tag ci:${{ github.ref_name }}-serverless public.ecr.aws/s5e9c0e3/ci:${{ github.ref_name }}-serverless
docker push public.ecr.aws/s5e9c0e3/ci:${{ github.ref_name }}-serverless