-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (93 loc) · 3.16 KB
/
test-build-ecr-image.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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
name: 'Run build-ecr-image workflow'
on:
pull_request:
paths:
- .github/workflows/build-ecr-image.yml
- .github/actions/test-build-ecr-image/*
permissions:
id-token: write # aws auth
contents: write # publish release assets
defaults:
run:
shell: bash
jobs:
# Build for Branch no ref
run-build-ecr-image-workflow:
uses: ./.github/workflows/build-ecr-image.yml
with:
file: .github/actions/test-build-ecr-image/Dockerfile
repository-name: github-actions-tests
role-name: github-actions-tests
build-args: VERSION=${{ github.sha }}
secrets:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}
test-build-ecr-image-workflow:
runs-on: ubuntu-latest
needs: run-build-ecr-image-workflow
steps:
- name: 'Checkout actions'
uses: actions/checkout@v2
- name: 'Test build-ecr-image workflow'
uses: ./.github/actions/test-build-ecr-image
with:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}
ref: ${{ github.sha }}
# Build for Branch name
run-build-ecr-image-workflow-on-branch-name:
uses: ./.github/workflows/build-ecr-image.yml
with:
file: .github/actions/test-build-ecr-image/Dockerfile
repository-name: github-actions-tests
role-name: github-actions-tests
build-args: VERSION=${{ github.base_ref }}
ref: ${{ github.base_ref }}
secrets:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}
# Build for SHA
run-build-ecr-image-workflow-on-github-sha:
uses: ./.github/workflows/build-ecr-image.yml
with:
file: .github/actions/test-build-ecr-image/Dockerfile
repository-name: github-actions-tests
role-name: github-actions-tests
build-args: VERSION=${{ github.sha }}
ref: ${{ github.sha }}
secrets:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}
# Build for Tag
run-build-ecr-image-workflow-tag:
uses: ./.github/workflows/build-ecr-image.yml
with:
ref: v2.6.4-rc.0
file: .github/actions/test-build-ecr-image/Dockerfile
repository-name: github-actions-tests
role-name: github-actions-tests
build-args: VERSION=v2.6.4-rc.0
secrets:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}
test-build-ecr-image-workflow-tag:
runs-on: ubuntu-latest
needs: run-build-ecr-image-workflow-tag
steps:
- name: 'Checkout actions'
uses: actions/checkout@v2
- name: 'Test build-ecr-image workflow'
uses: ./.github/actions/test-build-ecr-image
with:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}
ref: v2.6.4-rc.0
run-build-ecr-image-skip-if-exists:
needs: run-build-ecr-image-workflow-on-github-sha # The image has to have been created previously
uses: ./.github/workflows/build-ecr-image.yml
with:
# Copied from run-build-ecr-image-workflow-on-github-sha
file: .github/actions/test-build-ecr-image/Dockerfile
repository-name: github-actions-tests
role-name: github-actions-tests
build-args: VERSION=${{ github.sha }}
ref: ${{ github.sha }}
# And add the skip
skip-if-exists: true
secrets:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }}