Require full authentication for the system settings, as some of the s… #2545
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Docker Image Build | |
| permissions: | |
| contents: read | |
| on: | |
| #schedule: | |
| # - cron: '0 10 * * *' # everyday at 10am | |
| push: | |
| branches: | |
| - '**' | |
| - '!l10n_**' | |
| tags: | |
| - 'v*.*.*' | |
| - 'v*.*.*-**' | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| - platform: linux/amd64 | |
| runner: ubuntu-latest | |
| platform-slug: amd64 | |
| - platform: linux/arm64 | |
| runner: ubuntu-24.04-arm | |
| platform-slug: arm64 | |
| - platform: linux/arm/v7 | |
| runner: ubuntu-24.04-arm | |
| platform-slug: armv7 | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - | |
| name: Checkout | |
| uses: actions/checkout@v6 | |
| - | |
| name: Docker meta | |
| id: docker_meta | |
| uses: docker/metadata-action@v6 | |
| with: | |
| # list of Docker images to use as base name for tags | |
| images: | | |
| jbtronics/part-db1 | |
| # Mark the image build from master as latest (as we dont have really releases yet) | |
| tags: | | |
| type=edge,branch=master | |
| type=ref,event=branch | |
| type=ref,event=tag | |
| type=schedule | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| type=ref,event=pr | |
| labels: | | |
| org.opencontainers.image.source=${{ github.event.repository.clone_url }} | |
| org.opencontainers.image.revision=${{ github.sha }} | |
| org.opencontainers.image.title=Part-DB | |
| org.opencontainers.image.description=Part-DB is a web application for managing electronic components and your inventory. | |
| org.opencontainers.image.url=https://github.com/Part-DB/Part-DB-symfony | |
| org.opencontainers.image.source=https://github.com/Part-DB/Part-DB-symfony | |
| org.opencontainers.image.authors=Jan Böhmer | |
| org.opencontainers.licenses=AGPL-3.0-or-later | |
| # Disable automatic 'latest' tag in build jobs - it will be created in merge job | |
| flavor: | | |
| latest=false | |
| - | |
| name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - | |
| name: Login to DockerHub | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v4 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - | |
| name: Build and push by digest | |
| id: build | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| platforms: ${{ matrix.platform }} | |
| labels: ${{ steps.docker_meta.outputs.labels }} | |
| outputs: type=image,name=jbtronics/part-db1,push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' }} | |
| cache-from: type=gha,scope=build-${{ matrix.platform }} | |
| cache-to: type=gha,mode=max,scope=build-${{ matrix.platform }} | |
| - | |
| name: Export digest | |
| if: github.event_name != 'pull_request' | |
| run: | | |
| mkdir -p /tmp/digests | |
| digest="${{ steps.build.outputs.digest }}" | |
| touch "/tmp/digests/${digest#sha256:}" | |
| - | |
| name: Upload digest | |
| if: github.event_name != 'pull_request' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: digests-${{ matrix.platform-slug }} | |
| path: /tmp/digests/* | |
| if-no-files-found: error | |
| retention-days: 1 | |
| merge: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| if: github.event_name != 'pull_request' | |
| steps: | |
| - | |
| name: Download digests | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: /tmp/digests | |
| pattern: digests-* | |
| merge-multiple: true | |
| - | |
| name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - | |
| name: Docker meta | |
| id: docker_meta | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: | | |
| jbtronics/part-db1 | |
| tags: | | |
| type=edge,branch=master | |
| type=ref,event=branch | |
| type=ref,event=tag | |
| type=schedule | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| type=ref,event=pr | |
| - | |
| name: Login to DockerHub | |
| uses: docker/login-action@v4 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - | |
| name: Create manifest list and push | |
| working-directory: /tmp/digests | |
| run: | | |
| docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | |
| $(printf 'jbtronics/part-db1@sha256:%s ' *) | |
| - | |
| name: Inspect image | |
| run: | | |
| docker buildx imagetools inspect jbtronics/part-db1:${{ steps.docker_meta.outputs.version }} |