From e6fe177aa3d8203edf85423f4ca428d9ac49becf Mon Sep 17 00:00:00 2001 From: s3lph <5564491+s3lph@users.noreply.github.com> Date: Tue, 4 Feb 2025 18:32:58 +0100 Subject: [PATCH 1/4] chore: migrate from docker hub to ghcr --- .github/workflows/ci.yml | 20 +++++++++++++------- README.md | 7 +++++-- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 025b2c9..59624ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,25 +12,31 @@ jobs: runs-on: ubuntu-latest if: github.ref != 'refs/heads/master' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build Docker image run: | - docker build -t spaceapi/influxdb-sensor-logger:latest . + docker build -t ghcr.io/spaceapi-community/spaceapi-sensor-logger:latest . docker-publish: name: Publish Docker image runs-on: ubuntu-latest if: github.ref == 'refs/heads/master' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build Docker image run: | docker build \ --no-cache \ - -t spaceapi/influxdb-sensor-logger:latest \ - -t spaceapi/influxdb-sensor-logger:v1 \ + -t ghcr.io/spaceapi-community/spaceapi-sensor-logger:latest \ + -t ghcr.io/spaceapi-community/spaceapi-sensor-logger:v1 \ + --label "org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \ . + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Push Docker image run: | - docker login -u "${{ secrets.DOCKER_USERNAME }}" -p "${{ secrets.DOCKER_PASSWORD }}" && \ - docker push -a spaceapi/influxdb-sensor-logger + docker push -a ghcr.io/spaceapi-community/spaceapi-sensor-logger diff --git a/README.md b/README.md index 256e861..972aa06 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # SpaceAPI InfluxDB Sensor Logger -[![Docker Image Size (tag)](https://img.shields.io/docker/image-size/spaceapi/influxdb-sensor-logger/latest)](https://hub.docker.com/r/spaceapi/influxdb-sensor-logger) +[![Docker Image][docker-image-badge]][docker-image] A Python 3 script to relay sensor values from a SpaceAPI endpoint to an InfluxDB instance so it can be viewed in Grafana. @@ -41,7 +41,7 @@ Configure it using the following env vars: - `SPACEAPI_ENDPOINT` - `RELAY_INTERVAL_SECONDS` -The image is published at [docker.io/spaceapi/influxdb-sensor-logger](https://hub.docker.com/r/spaceapi/influxdb-sensor-logger). +The image is published at [ghcr.io/spaceapi-community/spaceapi-sensor-logger](https://ghcr.io/spaceapi-community/spaceapi-sensor-logger). ## License @@ -60,3 +60,6 @@ Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. + +[docker-image]: https://ghcr.io/spaceapi-community/spaceapi-sensor-logger +[docker-image-badge]: https://img.shields.io/badge/container%20image-ghcr.io/spaceapi-community/spaceapi-sensor-logger-blue.svg From 8e0826f75a0c90c1bab8d4c399f159b9037ded12 Mon Sep 17 00:00:00 2001 From: s3lph <5564491+s3lph@users.noreply.github.com> Date: Tue, 4 Feb 2025 18:36:22 +0100 Subject: [PATCH 2/4] ci: bump From 15eaa2a8c907832400fd692821ddee472f38e573 Mon Sep 17 00:00:00 2001 From: s3lph <5564491+s3lph@users.noreply.github.com> Date: Tue, 4 Feb 2025 18:46:52 +0100 Subject: [PATCH 3/4] chore(ci): split ci workflow into two workflows named build and publish --- .github/workflows/build.yml | 15 +++++++++++++++ .github/workflows/{ci.yml => publish.yml} | 16 ++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/build.yml rename .github/workflows/{ci.yml => publish.yml} (71%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..cab4267 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,15 @@ +on: + push: + +name: Build + +jobs: + + docker-build: + name: Build Docker image + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build Docker image + run: | + docker build -t ghcr.io/spaceapi-community/spaceapi-sensor-logger:latest . diff --git a/.github/workflows/ci.yml b/.github/workflows/publish.yml similarity index 71% rename from .github/workflows/ci.yml rename to .github/workflows/publish.yml index 59624ee..3e4320e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/publish.yml @@ -1,26 +1,18 @@ on: push: + branches: + - master + - chore-ghcr schedule: - cron: '30 3 * * 2' -name: CI +name: Publish jobs: - docker-build: - name: Build Docker image - runs-on: ubuntu-latest - if: github.ref != 'refs/heads/master' - steps: - - uses: actions/checkout@v4 - - name: Build Docker image - run: | - docker build -t ghcr.io/spaceapi-community/spaceapi-sensor-logger:latest . - docker-publish: name: Publish Docker image runs-on: ubuntu-latest - if: github.ref == 'refs/heads/master' steps: - uses: actions/checkout@v4 - name: Build Docker image From 9ab79f5e484bd1cc95fd0597604a38a8526a3caf Mon Sep 17 00:00:00 2001 From: s3lph <5564491+s3lph@users.noreply.github.com> Date: Tue, 4 Feb 2025 18:49:06 +0100 Subject: [PATCH 4/4] chore(ci): remove chore-ghcr branch match from publish workflow --- .github/workflows/publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3e4320e..8ecb782 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,7 +2,6 @@ on: push: branches: - master - - chore-ghcr schedule: - cron: '30 3 * * 2'