chore: release v3.1.1 #87
Workflow file for this run
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: Build & Push Docker Image | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| jobs: | |
| send-start-deploy-telegram-message: | |
| name: Send Telegram message | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v2 | |
| - name: Send Telegram message | |
| uses: appleboy/telegram-action@master | |
| with: | |
| to: ${{ secrets.TELEGRAM_CHAT_ID }} | |
| token: ${{ secrets.TELEGRAM_TOKEN }} | |
| format: html | |
| message: | | |
| 🏹 <b>Deploy</b> <code>${{ github.REPOSITORY }}@${{ github.ref_name }}</code> has started. | |
| ⏱️ <code>${{ github.event.head_commit.timestamp }}</code> | |
| build-docker-images: | |
| name: Build ${{ matrix.platform }} | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: linux/amd64 | |
| runner: ubuntu-latest | |
| - platform: linux/arm64 | |
| runner: ubuntu-24.04-arm | |
| steps: | |
| - name: Prepare platform pair | |
| run: | | |
| platform=${{ matrix.platform }} | |
| echo "PLATFORM_PAIR=${platform//\//-}" >> "$GITHUB_ENV" | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.TOKEN_GH_DEPLOY }} | |
| - name: Build and push by digest | |
| id: build | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: Dockerfile | |
| platforms: ${{ matrix.platform }} | |
| outputs: | | |
| type=image,"name=remnawave/node,ghcr.io/remnawave/node",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: | |
| name: Merge & push manifests | |
| needs: [build-docker-images] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download digests | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: ${{ runner.temp }}/digests | |
| pattern: digests-* | |
| merge-multiple: true | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.TOKEN_GH_DEPLOY }} | |
| - name: Create & push manifest lists | |
| working-directory: ${{ runner.temp }}/digests | |
| run: | | |
| docker buildx imagetools create \ | |
| -t remnawave/node:latest \ | |
| -t remnawave/node:${{ github.ref_name }} \ | |
| $(printf 'remnawave/node@sha256:%s ' *) | |
| docker buildx imagetools create \ | |
| -t ghcr.io/remnawave/node:latest \ | |
| -t ghcr.io/remnawave/node:${{ github.ref_name }} \ | |
| $(printf 'ghcr.io/remnawave/node@sha256:%s ' *) | |
| - name: Inspect image | |
| run: docker buildx imagetools inspect remnawave/node:${{ github.ref_name }} | |
| create-release: | |
| needs: [merge] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: NewTag | |
| id: tag | |
| uses: JinoArch/get-latest-tag@latest | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.TOKEN_GH_DEPLOY }} | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: v${{ github.ref_name }} | |
| generate_release_notes: true | |
| append_body: true | |
| make_latest: true | |
| draft: false | |
| prerelease: false | |
| body: | | |
| 🚀 Autogenerated release v${{ github.ref_name }} | |
| 📝 Compare changes: [${{ steps.tag.outputs.previousTag }}...${{ steps.tag.outputs.latestTag }}](https://github.com/${{ github.repository }}/compare/${{ steps.tag.outputs.previousTag }}...${{ steps.tag.outputs.latestTag }}) | |
| Latest Docker image: | |
| - `remnawave/node:latest` | |
| - `ghcr.io/remnawave/node:latest` | |
| Docker images: | |
| - `remnawave/node:${{github.ref_name}}` | |
| - `ghcr.io/remnawave/node:${{github.ref_name}}` | |
| send-telegram-message: | |
| name: Send Telegram message | |
| needs: [merge, create-release] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v2 | |
| - name: Send Telegram message | |
| uses: appleboy/telegram-action@master | |
| with: | |
| to: ${{ secrets.TELEGRAM_CHAT_ID }} | |
| token: ${{ secrets.TELEGRAM_TOKEN }} | |
| format: html | |
| message: | | |
| ✅ <b>Deploy</b> <code>${{ github.REPOSITORY }}@${{ github.ref_name }}</code> has finished. | |
| image tag: <code>${{ github.sha }}</code> | |
| notify-on-error: | |
| runs-on: ubuntu-latest | |
| needs: [build-docker-images, merge] | |
| if: failure() | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v2 | |
| - name: Send error notification | |
| uses: appleboy/telegram-action@master | |
| with: | |
| to: ${{ secrets.TELEGRAM_CHAT_ID }} | |
| token: ${{ secrets.TELEGRAM_TOKEN }} | |
| message: | | |
| ❌ ${{ github.REPOSITORY }}@${{ github.ref_name }} build failed |