Skip to content

Commit

Permalink
Enable multi-arch builds
Browse files Browse the repository at this point in the history
  • Loading branch information
sethforprivacy committed Aug 10, 2022
1 parent 2e63bd4 commit 65211c0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 13 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/update-base-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,23 @@ on:
schedule:
- cron: "0 12 * * 1" # Run every Monday at noon.
workflow_dispatch:

jobs:
rebuild-container:
name: "Rebuild Container with the latest base image"
runs-on: ubuntu-latest
steps:
-
-
name: Prepare outputs
id: prep
run: |
echo "::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2.0.0
with:
platforms: linux/arm64
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.0.0
-
Expand All @@ -30,12 +41,13 @@ jobs:
name: "Get p2pool Release Tag"
id: get_tag
run: echo "::set-output name=tag::$(awk -F "=" '/P2POOL_BRANCH=/ {print $2}' Dockerfile)"
-
name: Build and push to Docker Hub and Github Packages Docker Registry
-
name: Build and push to Docker Hub and GitHub Packages Docker Registry
id: docker_build
uses: docker/build-push-action@v3.1.1
with:
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ github.repository_owner }}/p2pool:latest
ghcr.io/${{ github.repository_owner }}/p2pool:${{ steps.get_tag.outputs.tag }}
Expand All @@ -45,6 +57,3 @@ jobs:
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
26 changes: 19 additions & 7 deletions .github/workflows/update-image-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,26 @@ name: "Update image and push to Github Packages and Docker Hub when Dockerfile i
# Run this workflow every time a new commit pushed to your repository
on:
push:
branches:
- main
paths:
- 'Dockerfile'
jobs:
rebuild-container:
name: "Rebuild Container with the latest base image"
runs-on: ubuntu-latest
steps:
-
-
name: Prepare outputs
id: prep
run: |
echo "::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2.0.0
with:
platforms: linux/arm64
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.0.0
-
Expand All @@ -31,12 +43,13 @@ jobs:
name: "Get p2pool Release Tag"
id: get_tag
run: echo "::set-output name=tag::$(awk -F "=" '/P2POOL_BRANCH=/ {print $2}' Dockerfile)"
-
name: Build and push to Docker Hub and Github Packages Docker Registry
id: docker_build
-
name: Build and push to Docker Hub and GitHub Packages Docker Registry
uses: docker/build-push-action@v3.1.1
id: docker_build_push
with:
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ github.repository_owner }}/p2pool:latest
ghcr.io/${{ github.repository_owner }}/p2pool:${{ steps.get_tag.outputs.tag }}
Expand All @@ -46,6 +59,5 @@ jobs:
org.opencontainers.image.source=${{ github.event.repository.html_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
cache-from: type=registry,ref=${{ secrets.DOCKER_USERNAME }}/simple-monerod:latest
cache-to: type=inline

0 comments on commit 65211c0

Please sign in to comment.