Skip to content

Force ARM Platform Docker Build for Graviton2 Compatibility #60

Force ARM Platform Docker Build for Graviton2 Compatibility

Force ARM Platform Docker Build for Graviton2 Compatibility #60

name: Build Container Only
on:
workflow_dispatch:
push:
paths-ignore:
# Exclude changes made in the root directory but not in the docker directory
- '*'
- '!docker'
- '!docker/**'
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
# build Docker image and push to ECR
- name: Login to AWS ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build Docker Image
run: docker buildx build --platform linux/arm64/v8 -t ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/wp:latest ./docker
- name: Push Docker Image
run: docker push ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/wp:latest