Skip to content

Commit

Permalink
chore(github-action): swap out aws credential (#2004)
Browse files Browse the repository at this point in the history
Use oidc method for aws auth
  • Loading branch information
RiceAndMeet authored Oct 17, 2023
1 parent 6c887df commit c4dd592
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 39 deletions.
41 changes: 27 additions & 14 deletions .github/workflows/build-latest-docker-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
os:
- ubuntu-20.04
runs-on: ${{ matrix.os }}
permissions:
id-token: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -32,20 +35,30 @@ jobs:
run: |
git fetch --unshallow
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: us-east-2
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/ghwf-axelar-core

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Build docker image (normal)
env:
WASM: ${{ github.event.inputs.WASM }}
run: |
make WASM="${WASM}" docker-image
- name: Push to ECR (normal)
uses: jwalton/gh-ecr-push@v1
with:
access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
region: us-east-2
local-image: axelar/core
image: axelar-core:${{ github.sha }}
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: axelar-core
IMAGE_TAG: ${{ github.sha }}
run: |
docker image tag axelar/core "${REGISTRY}/${REPOSITORY}:${IMAGE_TAG}"
docker push "${REGISTRY}/${REPOSITORY}:${IMAGE_TAG}"
- name: Build docker image (debug)
if: github.event.inputs.buildDebug != 'false'
Expand All @@ -55,11 +68,11 @@ jobs:
make WASM="${WASM}" docker-image-debug
- name: Push to ECR (debug)
uses: jwalton/gh-ecr-push@v1
if: github.event.inputs.buildDebug != 'false'
with:
access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
region: us-east-2
local-image: axelar/core-debug
image: axelar-core:${{ github.sha }}-debug
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: axelar-core
IMAGE_TAG: ${{ github.sha }}
run: |
docker image tag axelar/core "${REGISTRY}/${REPOSITORY}:${IMAGE_TAG}-debug"
docker push "${REGISTRY}/${REPOSITORY}:${IMAGE_TAG}-debug"
18 changes: 9 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go 1.21

require (
github.com/CosmWasm/wasmd v0.33.0
github.com/CosmWasm/wasmvm v1.3.0
github.com/armon/go-metrics v0.4.1
github.com/axelarnetwork/tm-events v0.0.0-20230704201410-3cf91089034b
github.com/axelarnetwork/utils v0.0.0-20230706045331-b7aacc1f4a2f
Expand All @@ -17,7 +18,7 @@ require (
github.com/golang/protobuf v1.5.3
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/matryer/moq v0.3.2
github.com/matryer/moq v0.3.3
github.com/miguelmota/go-ethereum-hdwallet v0.1.1
github.com/mitchellh/mapstructure v1.5.0
github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.5
Expand All @@ -34,12 +35,12 @@ require (
github.com/stretchr/testify v1.8.4
github.com/tendermint/tendermint v0.34.27
github.com/tendermint/tm-db v0.6.8-0.20220506192307-f628bb5dc95b
golang.org/x/crypto v0.13.0
golang.org/x/crypto v0.14.0
golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1
golang.org/x/mod v0.12.0
golang.org/x/sync v0.3.0
golang.org/x/mod v0.13.0
golang.org/x/sync v0.4.0
golang.org/x/text v0.13.0
golang.org/x/tools v0.13.0
golang.org/x/tools v0.14.0
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2
google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a
google.golang.org/grpc v1.55.0
Expand All @@ -54,7 +55,6 @@ require (
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.1 // indirect
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
github.com/CosmWasm/wasmvm v1.3.0 // indirect
github.com/DataDog/zstd v1.5.2 // indirect
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect
github.com/Workiva/go-datastructures v1.0.53 // indirect
Expand Down Expand Up @@ -171,9 +171,9 @@ require (
github.com/zondax/ledger-go v0.14.1 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/term v0.12.0 // indirect
golang.org/x/net v0.16.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
google.golang.org/genproto v0.0.0-20230526015343-6ee61e4f9d5f // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234015-3fc162c6f38a // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
Expand Down
32 changes: 16 additions & 16 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c4dd592

Please sign in to comment.