Add couchers upgrade instructions #13
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: Publish Couchers Chatwoot CE docker images | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: linux/amd64 | |
| runner: ubuntu-latest | |
| - platform: linux/arm64 | |
| runner: ubuntu-22.04-arm | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Set repository and image name to lowercase | |
| run: | | |
| echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV} | |
| echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME,,}" >>${GITHUB_ENV} | |
| env: | |
| IMAGE_NAME: '${{ github.repository }}' | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Prepare | |
| run: | | |
| platform=${{ matrix.platform }} | |
| echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV | |
| - name: Strip enterprise code | |
| run: | | |
| rm -rf enterprise | |
| rm -rf spec/enterprise | |
| - name: Set Chatwoot edition | |
| run: | | |
| echo -en '\nENV CW_EDITION="ce"' >> docker/Dockerfile | |
| - name: Set Docker Tags | |
| run: | | |
| echo "DOCKER_TAG=${FULL_IMAGE_NAME}:couchers-${{ github.sha }}" >> $GITHUB_ENV | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push by digest | |
| id: build | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/Dockerfile | |
| platforms: ${{ matrix.platform }} | |
| push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} | |
| outputs: type=image,name=${{ env.FULL_IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true | |
| - name: Export digest | |
| run: | | |
| mkdir -p ${{ runner.temp }}/digests | |
| digest="${{ steps.build.outputs.digest }}" | |
| touch "${{ runner.temp }}/digests/${digest#sha256:}" | |
| - name: Upload digest | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: digests-${{ env.PLATFORM_PAIR }} | |
| path: ${{ runner.temp }}/digests/* | |
| if-no-files-found: error | |
| retention-days: 1 | |
| merge: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| steps: | |
| - name: Set repository and image name to lowercase | |
| run: | | |
| echo "IMAGE_NAME=${IMAGE_NAME,,}" >>${GITHUB_ENV} | |
| echo "FULL_IMAGE_NAME=ghcr.io/${IMAGE_NAME,,}" >>${GITHUB_ENV} | |
| env: | |
| IMAGE_NAME: '${{ github.repository }}' | |
| - name: Download digests | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: ${{ runner.temp }}/digests | |
| pattern: digests-* | |
| merge-multiple: true | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Create manifest list and push | |
| working-directory: ${{ runner.temp }}/digests | |
| env: | |
| GIT_REF: ${{ github.head_ref || github.ref_name }} | |
| run: | | |
| TAG="${FULL_IMAGE_NAME}:couchers-${{ github.sha }}" | |
| docker buildx imagetools create -t $TAG \ | |
| $(printf '${{ env.FULL_IMAGE_NAME }}@sha256:%s ' *) | |
| - name: Inspect image | |
| env: | |
| GIT_REF: ${{ github.head_ref || github.ref_name }} | |
| run: | | |
| TAG="${FULL_IMAGE_NAME}:couchers-${{ github.sha }}" | |
| docker buildx imagetools inspect $TAG |