Skip to content

Commit

Permalink
Use OpenID Connect to deploy to ECR public (#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
at-wat authored Jun 29, 2022
1 parent e148ccc commit 397a7cb
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/tunnel-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
jobs:
tunnel-server:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
steps:
- name: Set image tag
if: startsWith(github.ref, 'refs/tags/v')
Expand Down Expand Up @@ -42,13 +46,17 @@ jobs:
docker push ${image}:latest
docker logout ghcr.io
- name: Login to ECR public
- name: Configure AWS credentials
if: startsWith(github.ref, 'refs/tags')
uses: docker/login-action@v2
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::610248501808:role/ci/GitHubActions-aws-iot-device-sdk-go
aws-region: us-east-1
- name: Login to Amazon ECR Public
if: startsWith(github.ref, 'refs/tags')
uses: aws-actions/amazon-ecr-login@v1
with:
registry: public.ecr.aws
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
registry-type: public
- name: Push to ECR public
if: startsWith(github.ref, 'refs/tags')
run: |
Expand Down

0 comments on commit 397a7cb

Please sign in to comment.