diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 3de0e67..b7e9fa0 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -12,6 +12,11 @@ env: jobs: BuildImage: runs-on: ubuntu-latest + strategy: + matrix: + CPU_ARCH: + - arm64 + - x86_64 # If running with act, Uncomment below # container: phaze9/action-runner env: @@ -19,24 +24,43 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - name: Set up Docker Buildx + id: buildx uses: docker/setup-buildx-action@v1 + + - name: Available platforms + run: echo ${{ steps.buildx.outputs.platforms }} - name: Login to ghcr.io uses: docker/login-action@v1 with: registry: ${{ env.IMAGE_REGISTRY }} username: ${{ env.IMAGE_OWNER }} - password: ${{ secrets.GITHUB_TOKEN }} + password: ${{ secrets.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 + 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 }}:latest + 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 + Deploy: runs-on: ubuntu-latest needs: BuildImage diff --git a/Dockerfile b/Dockerfile index 9c41cf3..5b19581 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:14.15.3-alpine AS base +FROM node:14.15.3 AS base LABEL version="4.1.0" LABEL description="" diff --git a/docker-compose.yml b/docker-compose.yml index f7848f6..6fc905e 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: "3" services: fluttershub.com: - image: ghcr.io/fluttershub/homepage:latest + image: ghcr.io/fluttershub/homepage:x64-latest restart: always networks: - external