forked from OffchainLabs/orbit-setup-script
-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (43 loc) · 1.72 KB
/
build-orbit-setup.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
name: Build orbit-setup Docker Image
on:
push:
tags: ["*"]
jobs:
docker:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: build and push orbit-setup
image: orbit-setup
dockerfile: Dockerfile
context: .
buildargs: ''
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Prepare Environment Variables
run: |
echo "SHORT_SHA=${GITHUB_SHA::7}" | tee -a $GITHUB_ENV
GIT_TAG=$(git tag --points-at HEAD)
echo "GIT_TAG=$GIT_TAG" | tee -a $GITHUB_ENV
echo "REF_NAME=$(echo ${GIT_TAG:-$GITHUB_REF_NAME} | sed 's/[^a-zA-Z0-9._]/-/g')" | tee -a $GITHUB_ENV
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.ECR_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.ECR_ACCESS_KEY }}
aws-region: us-west-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: ${{ matrix.name }}
uses: docker/build-push-action@v4
with:
context: ${{ matrix.context }}
push: true
tags: ${{ secrets.ECR_REGISTRY }}/${{ matrix.image }}:${{ github.sha }} , ${{ secrets.ECR_REGISTRY }}/${{ matrix.image }}:${{ env.SHORT_SHA }} , ${{ secrets.ECR_REGISTRY }}/${{ matrix.image }}:${{ env.REF_NAME }} , ${{ secrets.ECR_REGISTRY }}/${{ matrix.image }}:${{ env.REF_NAME }}-${{ env.SHORT_SHA }} , ${{ secrets.ECR_REGISTRY }}/${{ matrix.image }}:latest
file: ${{ matrix.dockerfile }}
provenance: false