From 5f5479e21519659f62b238f52ad4581b8fa81ee1 Mon Sep 17 00:00:00 2001 From: Sunny Guduru Date: Fri, 5 Apr 2024 12:13:22 -0700 Subject: [PATCH] chore: retrieve docker user and token from aws and login to docker (#131) --- .github/actions/publish/action.yml | 16 +++++++++------- .github/workflows/release-please.yml | 15 ++++++++++----- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/actions/publish/action.yml b/.github/actions/publish/action.yml index a8343ff3..5aec8c88 100644 --- a/.github/actions/publish/action.yml +++ b/.github/actions/publish/action.yml @@ -19,14 +19,16 @@ outputs: runs: using: composite steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 with: - fetch-depth: 0 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: stable + platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/386 + - name: Login to Docker + shell: bash + run: | + echo $DOCKER_TOKEN | docker login --username $DOCKER_USERNAME --password-stdin - name: Run Goreleaser uses: goreleaser/goreleaser-action@v5 with: diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index ffefed2e..751cd3b2 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -28,13 +28,18 @@ jobs: outputs: hashes: ${{ steps.publish.outputs.hashes }} steps: - - name: Checkout - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + name: Checkout with: fetch-depth: 0 - - - id: publish - uses: ./.github/actions/publish + + - uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.1 + name: 'Get Docker token' + with: + aws_assume_role: ${{ vars.AWS_ROLE_ARN }} + ssm_parameter_pairs: '/global/services/docker/public/username = DOCKER_USERNAME, /global/services/docker/public/token = DOCKER_TOKEN' + + - uses: ./.github/actions/publish with: dry-run: 'false' token: ${{ secrets.GITHUB_TOKEN }}