-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (32 loc) · 890 Bytes
/
push.yml
File metadata and controls
37 lines (32 loc) · 890 Bytes
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
on:
push:
branches:
- "*"
name: Push to Amazon ECR
jobs:
push-to-ecr:
name: Push Image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Extract branch name
shell: bash
run: |
BRANCH=$(echo ${GITHUB_REF#refs/heads/})
if [ "$BRANCH" = "main" ]; then
TAG="latest"
else
TAG="$BRANCH"
fi
echo "##[set-output name=tag;]$TAG"
id: extract_branch
- name: Docker ECR
uses: kciter/aws-ecr-action@v4
with:
access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
account_id: ${{ secrets.AWS_ACCOUNT_ID }}
region: eu-west-1
repo: unguess-core
tags: ${{ steps.extract_branch.outputs.tag }}