-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (72 loc) · 2.46 KB
/
docker-ci-push.yaml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
name: Docker Push
on: # yamllint disable-line rule:truthy
pull_request:
branches:
- main
# workflow_run:
# workflows: ["Tag"]
# types:
# - completed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_and_push_poc:
name: Build & Push Image - POC
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
pull-requests: write
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set output
id: vars
run: |
echo "git_tag=${{ github.ref_name }}" >> $GITHUB_OUTPUT
echo "DOCKERHUB_TOKEN=${{ secrets.SF_REF_ARCH_DOCKERHUB_TOKEN }}" >> $GITHUB_OUTPUT
echo "DOCKERHUB_USERNAME=${{ secrets.SF_REF_ARCH_DOCKERHUB_USERNAME }}" >> $GITHUB_OUTPUT
# configure iam
- name: Configure IAM Role
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.POC_BACKSTAGE_DEPLOY_ARN }}
aws-region: us-east-1
continue-on-error: false
- name: Build, Tag, and Push
run: |
export IMAGE_TAG=${{ steps.vars.outputs.git_tag }}
export ENVIRONMENT=poc
export DOCKERHUB_TOKEN=${{ secrets.SF_ARCH_DOCKERHUB_PASSWORD }}
export DOCKERHUB_USERNAME=${{ secrets.SF_ARCH_DOCKERHUB_USERNAME }}
export POC_BACKSTAGE_DEPLOY_ARN=${{ secrets.POC_BACKSTAGE_DEPLOY_ARN }}
./scripts/docker-build-tag-and-push.sh
# build_and_push_prod:
# name: Build & Push Image - Prod
# runs-on: ubuntu-latest
# permissions:
# id-token: write
# contents: read
# pull-requests: write
# # if: ${{ github.event.workflow_run.conclusion == 'success' }}
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Set output
# id: vars
# run: echo "git_tag=${{ github.ref_name }}" >> $GITHUB_OUTPUT
# # configure iam
# - name: Configure IAM Role
# uses: aws-actions/configure-aws-credentials@v2
# with:
# role-to-assume: ${{ secrets.PROD_BACKSTAGE_DEPLOY_ARN }}
# aws-region: us-east-1
# continue-on-error: false
# - name: Build, Tag, and Push
# run: |
# export IMAGE_TAG=${{ steps.vars.outputs.git_tag }}
# export ENVIRONMENT=prod
# ./scripts/docker-build-tag-and-push.sh