Skip to content

Commit b83d1b9

Browse files
Merge pull request #3 from inplayer-org/push-workflow
Push workflow
2 parents 71090d3 + 4456ada commit b83d1b9

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

.github/workflows/push.yaml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Push Image
2+
3+
on:
4+
push:
5+
tags:
6+
- v*.*.*
7+
jobs:
8+
build-and-push:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out
12+
- uses: actions/checkout@v2
13+
- name: Docker meta
14+
id: meta
15+
uses: docker/metadata-action@v3
16+
with:
17+
# list of Docker images to use as base name for tags
18+
images: |
19+
${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/stripe-mock
20+
# generate Docker tags based on the following events/attributes
21+
tags: |
22+
type=pep440,pattern={{version}}
23+
- name: Configure AWS credentials
24+
uses: aws-actions/configure-aws-credentials@v1
25+
with:
26+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
27+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
28+
aws-region: ${{ secrets.AWS_REGION }}
29+
- name: Login to Amazon ECR
30+
id: login-ecr
31+
uses: aws-actions/amazon-ecr-login@v1
32+
- name: Build and push image
33+
id: docker_build
34+
uses: docker/build-push-action@v2
35+
with:
36+
context: .
37+
push: true
38+
tags: ${{ steps.meta.outputs.tags }}
39+
labels: ${{ steps.meta.outputs.labels }}

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GIT_COMMITSHA = $(shell git rev-parse HEAD)
22
IMAGE_NAME = "stripemock/stripe-mock"
33

4-
all: test vet lint check-gofmt build
4+
all: test vet lint build
55

66
build:
77
go build -mod=vendor -o stripe-mock

0 commit comments

Comments
 (0)