forked from h2ouw8n4/wordpressOnAWS
-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (30 loc) · 1.18 KB
/
build-docker-only.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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