Skip to content

Commit

Permalink
update docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
epociask committed Aug 23, 2024
1 parent 1518a52 commit c963211
Showing 1 changed file with 12 additions and 21 deletions.
33 changes: 12 additions & 21 deletions .github/workflows/docker-eigenda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,29 @@ jobs:
uses: actions/checkout@v4
with:
submodules: 'recursive'
ssh-key: ${{ secrets.SSH_KEY }}

- # Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
name: Set up QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Prepare Environment Variables
run: |
echo "SHORT_SHA=${GITHUB_SHA::7}" | tee -a $GITHUB_ENV
GIT_TAG=$(git tag --points-at HEAD)
echo "GIT_TAG=$GIT_TAG" | tee -a $GITHUB_ENV
echo "REF_NAME=$(echo ${GIT_TAG:-$GITHUB_REF_NAME} | sed 's/[^a-zA-Z0-9._]/-/g')" | tee -a $GITHUB_ENV
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.ECR_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.ECR_ACCESS_KEY }}
aws-region: us-west-2
install: true

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ secrets.ECR_REGISTRY }}/${{ matrix.image }}
ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}
tags: |
type=ref,event=branch
type=ref,event=pr
Expand All @@ -70,4 +61,4 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: ${{ matrix.dockerfile }}
provenance: false
provenance: false

0 comments on commit c963211

Please sign in to comment.