Repository navigation
Merge pull request #1085 from nextcloud/fix/missing-translation-strings #831
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
| # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors | |
| # SPDX-License-Identifier: MIT | |
| name: Docker image | |
| on: | |
| release: | |
| types: [published] | |
| push: | |
| branches: | |
| - main | |
| - master | |
| - stable* | |
| env: | |
| GHCR_REPO: ghcr.io/${{ github.repository_owner }}/whiteboard | |
| jobs: | |
| build: | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 30 | |
| strategy: | |
| matrix: | |
| platform: | |
| - linux/amd64 | |
| - linux/arm64 | |
| steps: | |
| - name: Set vars | |
| id: vars | |
| run: | | |
| if [[ "${{ github.event_name }}" == "release" ]]; then | |
| if [[ "${{ github.event.release.prerelease }}" == "true" ]]; then | |
| echo "version_channel=beta" >> $GITHUB_OUTPUT | |
| else | |
| echo "version_channel=stable" >> $GITHUB_OUTPUT | |
| fi | |
| else | |
| echo "version_channel=daily" >> $GITHUB_OUTPUT | |
| fi | |
| echo "version=${{ github.sha }}" >> $GITHUB_OUTPUT | |
| echo "platform=$(echo -n ${{ matrix.platform }} | sed 's/\//-/g')" >> $GITHUB_OUTPUT | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0 | |
| - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 | |
| - name: Login to Github Container Registry | |
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build docker images | |
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | |
| with: | |
| context: . | |
| push: true | |
| platforms: ${{ matrix.platform }} | |
| provenance: false | |
| tags: | | |
| ${{ env.GHCR_REPO}}:${{ steps.vars.outputs.version }}-${{ steps.vars.outputs.platform }} | |
| release: | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 10 | |
| needs: build | |
| steps: | |
| - name: Set vars | |
| id: vars | |
| run: | | |
| if [[ "${{ github.event_name }}" == "release" ]]; then | |
| if [[ "${{ github.event.release.prerelease }}" == "true" ]]; then | |
| echo "version_channel=beta" >> $GITHUB_OUTPUT | |
| else | |
| echo "version_channel=stable" >> $GITHUB_OUTPUT | |
| fi | |
| else | |
| echo "version_channel=daily" >> $GITHUB_OUTPUT | |
| fi | |
| echo "version_ref=${{ github.event_name == 'release' && github.ref_name || github.sha }}" >> $GITHUB_OUTPUT | |
| echo "version=${{ github.sha }}" >> $GITHUB_OUTPUT | |
| - name: Login to Github Container Registry | |
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create GHCR manifest | |
| run: | | |
| # Create manifest for the specific version (tag name or commit SHA) | |
| docker manifest create $GHCR_REPO:${{ steps.vars.outputs.version_ref }} \ | |
| $GHCR_REPO:${{ steps.vars.outputs.version }}-linux-amd64 \ | |
| $GHCR_REPO:${{ steps.vars.outputs.version }}-linux-arm64 | |
| # Create manifest for the channel (release, prerelease, or daily) | |
| docker manifest create $GHCR_REPO:${{ steps.vars.outputs.version_channel }} \ | |
| $GHCR_REPO:${{ steps.vars.outputs.version }}-linux-amd64 \ | |
| $GHCR_REPO:${{ steps.vars.outputs.version }}-linux-arm64 | |
| # Create 'latest' tag only for stable releases (not pre-releases) | |
| if [[ "${{ steps.vars.outputs.version_channel }}" == "stable" ]]; then | |
| docker manifest create $GHCR_REPO:latest \ | |
| $GHCR_REPO:${{ steps.vars.outputs.version }}-linux-amd64 \ | |
| $GHCR_REPO:${{ steps.vars.outputs.version }}-linux-arm64 | |
| fi | |
| - name: Push manifests | |
| run: | | |
| docker manifest push $GHCR_REPO:${{ steps.vars.outputs.version_ref }} | |
| docker manifest push $GHCR_REPO:${{ steps.vars.outputs.version_channel }} | |
| # Push 'latest' tag only for stable releases | |
| if [[ "${{ steps.vars.outputs.version_channel }}" == "stable" ]]; then | |
| docker manifest push $GHCR_REPO:latest | |
| fi |