-
Notifications
You must be signed in to change notification settings - Fork 5
38 lines (37 loc) · 1.37 KB
/
public-ecr.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
# .github/workflows/public-ecr.yml
name: Build and Push roxprox
on:
push:
branches:
- master
tags:
- '[0-9]+.[0-9]+.[0-9]+'
permissions:
id-token: write
contents: write # This is required for actions/checkout@v1
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Git clone the repository
uses: actions/checkout@v1
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@master
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNTID }}:role/github-openvpn
role-session-name: samplerolesession
aws-region: eu-west-1
- name: Docker Login (ECR)
run: aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/y9x3p3i6
- name: Docker Builld
run: docker build -t roxprox .
- name: Tag and push latest
if: endsWith(github.ref, '/master')
run: |
docker tag roxprox:latest public.ecr.aws/y9x3p3i6/roxprox:latest
docker push public.ecr.aws/y9x3p3i6/roxprox:latest
- name: Tag and push specific version
if: startsWith(github.ref, 'refs/tags/')
run: |
docker tag roxprox:latest public.ecr.aws/y9x3p3i6/roxprox:${{ github.ref_name }}
docker push public.ecr.aws/y9x3p3i6/roxprox:${{ github.ref_name }}