From 71cf7baa327b9b8aff7c17c75aa8054481a33df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20MARQUET?= <72651575+BreizhHardware@users.noreply.github.com> Date: Thu, 24 Oct 2024 13:26:18 +0000 Subject: [PATCH] Add arm64 and armv7 compatibility --- .github/workflows/create_release_arm64.yml | 38 +++++++++++++++++ .github/workflows/create_release_armv7.yml | 38 +++++++++++++++++ README.md | 48 +++++++++++++++++++++- 3 files changed, 122 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/create_release_arm64.yml create mode 100644 .github/workflows/create_release_armv7.yml diff --git a/.github/workflows/create_release_arm64.yml b/.github/workflows/create_release_arm64.yml new file mode 100644 index 0000000..4d3e577 --- /dev/null +++ b/.github/workflows/create_release_arm64.yml @@ -0,0 +1,38 @@ +name: Docker Build and Release for arm64 + +on: + push: + branches: + - main + +jobs: + build-and-push-on-docker-hub: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + install: true + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + push: true + platforms: linux/arm64 + tags: ${{ secrets.DOCKER_USERNAME }}/github-ntfy:arm64 \ No newline at end of file diff --git a/.github/workflows/create_release_armv7.yml b/.github/workflows/create_release_armv7.yml new file mode 100644 index 0000000..13ea5d9 --- /dev/null +++ b/.github/workflows/create_release_armv7.yml @@ -0,0 +1,38 @@ +name: Docker Build and Release for armv7 + +on: + push: + branches: + - main + +jobs: + build-and-push-on-docker-hub: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm/v7 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + install: true + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + push: true + platforms: linux/arm/v7 + tags: ${{ secrets.DOCKER_USERNAME }}/github-ntfy:armv7 \ No newline at end of file diff --git a/README.md b/README.md index 8cdf383..1c97ccc 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ ntfy_url: the url of the ntfy server including the topic python ntfy.py ```` ## Docker: -If you want to use the docker image you can use the following docker-compose file: +If you want to use the docker image you can use the following docker-compose file for x86_64: ````yaml services: github-ntfy: @@ -41,6 +41,50 @@ services: - 80:80 restart: unless-stopped ```` +For arm64 this docker compose file is ok: +````yaml +services: + github-ntfy: + image: breizhhardware/github-ntfy:arm64 + container_name: github-ntfy + environment: + - USERNAME=username # Required + - PASSWORD=password # Required + - NTFY_URL=ntfy_url # Required if ntfy is used + - GHNTFY_TIMEOUT=timeout # Default is 3600 (1 hour) + - GHNTFY_TOKEN= # Default is empty (Github token) + - DOCKER_USERNAME= # Default is empty (Docker Hub username) + - DOCKER_PASSWORD= # Default is empty (Docker Hub password) + - GOTIFY_URL=gotify_url # Required if gotify is used + - GOTIFY_TOKEN= # Required if gotify is used + volumes: + - /path/to/github-ntfy:/github-ntfy/ + ports: + - 80:80 + restart: unless-stopped +```` +For armV7 this docker compose is ok: +````yaml +services: + github-ntfy: + image: breizhhardware/github-ntfy:armv7 + container_name: github-ntfy + environment: + - USERNAME=username # Required + - PASSWORD=password # Required + - NTFY_URL=ntfy_url # Required if ntfy is used + - GHNTFY_TIMEOUT=timeout # Default is 3600 (1 hour) + - GHNTFY_TOKEN= # Default is empty (Github token) + - DOCKER_USERNAME= # Default is empty (Docker Hub username) + - DOCKER_PASSWORD= # Default is empty (Docker Hub password) + - GOTIFY_URL=gotify_url # Required if gotify is used + - GOTIFY_TOKEN= # Required if gotify is used + volumes: + - /path/to/github-ntfy:/github-ntfy/ + ports: + - 80:80 + restart: unless-stopped +```` GHNTFY_TOKEN, need to have repo, read:org and read:user Docker Hub repo: https://hub.docker.com/r/breizhhardware/github-ntfy @@ -53,7 +97,7 @@ Docker Hub repo: https://hub.docker.com/r/breizhhardware/github-ntfy - [ ] Rework of the web interface - [x] Compatibility with Gotify - [ ] Compatibility with Discord Webhook -- [ ] Compatibility and distribution for arm64 and armv7 +- [x] Compatibility and distribution for arm64 and armv7 # Bash setup-notify.sh ## Description: This script is used to setup the ntfy notification system on ssh login for a new server.