Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

:whale: A GH action for building and publishing multi-arch Docker image to various registries

Alicia Sykes3d5dbed0b637
diff --git a/.github/workflows/docker-build-publish.yml b/.github/workflows/docker-build-publish.yml
new file mode 100644
index 00000000..3ecdeff7
--- /dev/null
+++ b/.github/workflows/docker-build-publish.yml
@@ -0,0 +1,96 @@
+# Builds, scans and tests the multi-architecture docker image
+# Then releases it to the DockerHub, GHCR and Quay registries
+name: 🐳 Build + Publish Multi-Platform Image
+
+on:
+ push:
+ branches: ['master']
+ tags: [v*]
+
+env:
+ DH_IMAGE: ${{ secrets.DOCKER_REPO }}
+ GH_IMAGE: ${{ github.repository_owner }}/${{ github.event.repository.name }}
+
+jobs:
+ docker:
+ runs-on: ubuntu-latest
+ permissions: { contents: read, packages: write }
+ if: "!contains(github.event.head_commit.message, '[ci-skip]')"
+
+ steps:
+ - name: πŸ›ŽοΈ Checkout Repo
+ uses: actions/checkout@v2
+
+ - name: πŸ”– Get App Version
+ uses: tyankatsu0105/read-package-version-actions@v1
+ id: package-version
+
+ # - name: ✨ Validate Dockerfile
+ # uses: ghe-actions/dockerfile-validator@v1
+ # with:
+ # dockerfile: 'Dockerfile'
+ # lint: 'hadolint'
+
+ - name: πŸ—‚οΈ Make Docker Meta
+ id: meta
+ uses: docker/metadata-action@v3
+ with:
+ images: |
+ ${{ env.DH_IMAGE }}
+ ghcr.io/${{ env.GH_IMAGE }}
+ ${{ secrets.ACR_SERVER }}/${{ secrets.ACR_USERNAME }}
+ tags: |
+ type=ref,event=tag,prefix=release-,suffix={{tag}}
+ type=semver,pattern={{raw}},value=${{ steps.package-version.outputs.version }}
+ labels: |
+ maintainer=Lissy93
+ org.opencontainers.image.title=Dashy
+ org.opencontainers.image.description=A self-hosted startpage for your server
+ org.opencontainers.image.documentation=https://dashy.to/docs
+ org.opencontainers.image.authors=Alicia Sykes
+ org.opencontainers.image.licenses=MIT
+
+ - name: πŸ”§ Set up QEMU
+ uses: docker/setup-qemu-action@v1
+
+ - name: πŸ”§ Set up Docker Buildx
+ uses: docker/setup-buildx-action@v1
+
+ - name: πŸ”‘ Login to DockerHub
+ uses: docker/login-action@v1
+ with:
+ username: ${{ secrets.DOCKER_USERNAME }}
+ password: ${{ secrets.DOCKER_PASSWORD }}
+
+ - name: πŸ”‘ Login to GitHub Container Registry
+ uses: docker/login-action@v1
+ with:
+ registry: ghcr.io
+ username: ${{ github.repository_owner }}
+ password: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: πŸ”‘ Login to Azure Container Registry
+ uses: docker/login-action@v1
+ with:
+ registry: ${{ secrets.ACR_SERVER }}
+ username: ${{ secrets.ACR_USERNAME }}
+ password: ${{ secrets.ACR_PASSWORD }}
+
+ - name: βš’οΈ Build and push
+ uses: docker/build-push-action@v2
+ with:
+ context: .
+ file: ./Dockerfile
+ platforms: linux/amd64,linux/arm64,linux/arm/v7
+ tags: ${{ steps.meta.outputs.tags }}
+ labels: ${{ steps.meta.outputs.labels }}
+ push: true
+
+ - name: πŸ’¬ Set Docker Hub Description
+ uses: peter-evans/dockerhub-description@v2
+ with:
+ repository: lissy93/dashy
+ readme-filepath: ./README.md
+ short-description: Dashy - A self-hosted start page for your server
+ username: ${{ secrets.DOCKER_USERNAME }}
+ password: ${{ secrets.DOCKER_PASSWORD }}