Skip to content

Commit 81a99bb

Browse files
committed
push to ecr
1 parent 2ed22ec commit 81a99bb

File tree

1 file changed

+26
-25
lines changed

1 file changed

+26
-25
lines changed

.github/workflows/publish.yml

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,6 @@ jobs:
2222
steps:
2323
- name: Checkout repository
2424
uses: actions/checkout@v4
25-
- name: Log in to the Container registry
26-
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
27-
with:
28-
registry: ${{ env.REGISTRY }}
29-
username: ${{ github.actor }}
30-
password: ${{ secrets.GITHUB_TOKEN }}
31-
- name: Extract metadata (tags, labels) for Docker
32-
id: meta
33-
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
34-
with:
35-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3625

3726
- name: Install rust
3827
uses: risc0/risc0/.github/actions/rustup@main
@@ -43,29 +32,41 @@ jobs:
4332
cargo install cargo-binstall --version '=1.6.9' --locked
4433
cargo binstall cargo-risczero@1.1.1 --no-confirm --force
4534
cargo risczero install
35+
4636
- name: Install Foundry
4737
uses: risc0/foundry-toolchain@2fe7e70b520f62368a0e3c464f997df07ede420f
38+
4839
- name: cargo check to build ELF and image ID
4940
env:
5041
RISC0_USE_DOCKER: true
5142
run: cargo check
43+
5244
- name: Delete unnecessary cache files to save disk space for docker build
5345
run: sudo rm -rf "/usr/local/share/boost" "$AGENT_TOOLSDIRECTORY" ./target/debug
5446

55-
- name: Build and push Docker image
56-
id: push
57-
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
47+
- name: configure aws credentials
48+
uses: aws-actions/configure-aws-credentials@v4
5849
with:
59-
context: .
60-
file: ./dockerfiles/blobstream0.Dockerfile
61-
push: true
62-
tags: ${{ steps.meta.outputs.tags }}
63-
labels: ${{ steps.meta.outputs.labels }}
64-
65-
- name: Generate artifact attestation
66-
uses: actions/attest-build-provenance@v1
50+
aws-region: 'us-west-2'
51+
role-to-assume: arn:aws:iam::299470750068:role/github-actions-assume-role
52+
53+
- name: configure federated aws credentials
54+
uses: aws-actions/configure-aws-credentials@v4
6755
with:
68-
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
69-
subject-digest: ${{ steps.push.outputs.digest }}
70-
push-to-registry: true
56+
aws-region: 'us-west-2'
57+
role-to-assume: arn:aws:iam::559050242814:role/github-federated-actions-bonsai-services
58+
role-chaining: true
59+
role-skip-session-tagging: true
7160

61+
- name: Login to Amazon ECR
62+
id: login-ecr
63+
uses: aws-actions/amazon-ecr-login@v2
64+
65+
- name: Build, tag, and push docker image to Amazon ECR
66+
env:
67+
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
68+
REPOSITORY: bonsaiservices
69+
IMAGE_TAG: ${{ github.sha }}
70+
run: |
71+
docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG -f ./dockerfiles/blobstream0.Dockerfile .
72+
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG

0 commit comments

Comments
 (0)