From b6e12e24abbf3e0e1a91a967cf45204d6e1f0467 Mon Sep 17 00:00:00 2001 From: Phoenix / Hotaru Date: Tue, 1 Mar 2022 17:35:48 +0000 Subject: [PATCH] Update Builder for ARM --- .github/workflows/release.yml | 30 ++++++++++++++++++++++++------ Dockerfile | 4 +--- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8c0231f..117225d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,12 +6,18 @@ on: - main # Set a branch to deploy env: - IMAGE_REPO: ghcr.io/hotarublaze - IMAGE_NAME: fluttershub-blog + IMAGE_REGISTRY: ghcr.io + IMAGE_OWNER: fluttershub + IMAGE_NAME: blog jobs: deploy: runs-on: ubuntu-18.04 + strategy: + matrix: + CPU_ARCH: + - arm64 + - x86_64 # If running with act, Uncomment below container: phaze9/action-runner steps: @@ -38,10 +44,22 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push - id: docker_build + - name: Build and push - x64 + id: docker_build_x64 uses: docker/build-push-action@v2 + if: ${{ matrix.CPU_ARCH == 'x86_64'}} with: push: true - platforms: linux/amd64,linux/arm64 - tags: ${{ env.IMAGE_REPO }}/${{ env.IMAGE_NAME }}:latest + platforms: linux/amd64 + labels: org.opencontainers.image.source https://github.com/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }} + tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}:x64-latest + + - name: Build and push - arm64 + id: docker_build_arm64 + uses: docker/build-push-action@v2 + if: ${{ matrix.CPU_ARCH == 'arm64'}} + with: + push: true + platforms: linux/arm64 + labels: org.opencontainers.image.source https://github.com/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }} + tags: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_OWNER }}/${{ env.IMAGE_NAME }}:arm-latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index db1f190..f79d742 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,4 @@ -FROM node:14.15.3-alpine AS base - -FROM nginx:1.19.6-alpine as Web +FROM nginx:1.19.6-alpine as web LABEL maintainer="Phoenix (https://github.com/HotaruBlaze)" COPY docker/nginx.conf /etc/nginx/nginx.conf COPY docker/web.conf /etc/nginx/conf.d/web.conf