Build Container Only #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v4 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
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@v2 | |
- name: Set up for ARM Build | |
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | |
- name: Build Docker Image | |
run: docker buildx build --platform linux/arm64/v8 -t ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/wordpress:latest ./docker | |
- name: Push Docker Image | |
run: docker push ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com/wordpress:latest |