Skip to content

Publish Pinepods Nightly Multi-Architecture Image to DockerHub #37

Publish Pinepods Nightly Multi-Architecture Image to DockerHub

Publish Pinepods Nightly Multi-Architecture Image to DockerHub #37

name: Publish Pinepods Nightly Multi-Architecture Image to DockerHub
on:
schedule:
- cron: "23 1 * * *"
env:
REGISTRY: docker.io
IMAGE_NAME: madeofpendletonwool/pinepods
NIGHTLY_TAG: nightly
jobs:
build-and-push-nightly:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: linux/amd64,linux/arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_KEY }}
- name: Build and push x86 image
run: |
docker build --platform linux/amd64 -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.NIGHTLY_TAG }}-amd64 -f dockerfile .
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.NIGHTLY_TAG }}-amd64
- name: Build and push ARMv8 image
run: |
docker build --platform linux/arm64 -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.NIGHTLY_TAG }}-arm64 -f dockerfile-arm .
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.NIGHTLY_TAG }}-arm64
- name: Create and push Docker manifest for the nightly tag
run: |
docker manifest create ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.NIGHTLY_TAG }} \
--amend ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.NIGHTLY_TAG }}-amd64 \
--amend ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.NIGHTLY_TAG }}-arm64
docker manifest push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.NIGHTLY_TAG }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}