Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.

Commit 7c7c9fd

Browse files
authored
Migrate to AWS ECR (#57)
Migrate to AWS ECR for our docker images, following the recent changes with Docker Hub.
1 parent 79b3267 commit 7c7c9fd

File tree

1 file changed

+23
-11
lines changed

1 file changed

+23
-11
lines changed

.github/workflows/containers.yml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ jobs:
1212
name: Applications
1313
runs-on: ubuntu-20.04
1414
strategy:
15+
fail-fast: false
1516
matrix:
1617
app:
1718
- api
1819
- mjml
1920
- tasks
21+
permissions:
22+
contents: read
23+
id-token: write
2024
steps:
2125
- uses: actions/checkout@v3
2226

@@ -29,23 +33,31 @@ jobs:
2933
${{ runner.os }}-buildx-${{ hashFiles('**/poetry.lock') }}-
3034
${{ runner.os }}-buildx-
3135
32-
- uses: docker/setup-buildx-action@v2
33-
- uses: docker/login-action@v2
36+
- uses: aws-actions/configure-aws-credentials@v2
37+
with:
38+
role-to-assume: ${{ secrets.AWS_ROLE }}
39+
role-session-name: ${{ github.run_id }}
40+
aws-region: us-east-1
41+
42+
- uses: aws-actions/amazon-ecr-login@v1
43+
id: login-ecr
3444
with:
35-
username: ${{ secrets.DOCKERHUB_USERNAME }}
36-
password: ${{ secrets.DOCKERHUB_TOKEN }}
45+
registry-type: public
46+
47+
- uses: docker/setup-buildx-action@v2
3748

3849
- uses: docker/metadata-action@v4
3950
id: meta
4051
with:
41-
images: wafflehacks/application-portal
52+
images: ${{ steps.login-ecr.outputs.registry }}/wafflehacks/application-portal-${{ matrix.app }}
4253
tags: |
43-
type=ref,event=branch,prefix=${{ matrix.app }}-
44-
type=semver,pattern=${{ matrix.app }}-{{version}}
45-
type=semver,pattern=${{ matrix.app }}-{{major}}.{{minor}}
46-
type=semver,pattern=${{ matrix.app }}-{{major}}
47-
type=sha,prefix=${{ matrix.app }}-
48-
type=raw,value=${{ matrix.app }}-latest
54+
type=ref,event=branch
55+
type=ref,event=pr
56+
type=semver,pattern={{version}}
57+
type=semver,pattern={{major}}.{{minor}}
58+
type=semver,pattern={{major}}
59+
type=sha
60+
type=raw,value=latest,enable={{is_default_branch}}
4961
5062
- uses: docker/build-push-action@v4
5163
with:

0 commit comments

Comments
 (0)