-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (41 loc) · 1.19 KB
/
docker_push_dev.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
49
name: deploy-to-dev
on:
push:
tags:
- "v*"
env:
IMAGE_NAME: geff
jobs:
container_builder:
name: Builds and pushes the GEFF container image
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@master
with:
aws-region: us-west-2
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME_DEV }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Docker meta
id: meta
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
uses: docker/metadata-action@v4
with:
images: ${{ env.ECR_REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker images
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
- name: Log out of Amazon ECR
if: always()
run: docker logout ${{ steps.login-ecr.outputs.registry }}