From 7afa5086fd80b5ae6cb27d3be13b7b8d64de88e9 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Sun, 25 Aug 2024 21:16:25 +0100 Subject: [PATCH] Use forgejo registry for the image --- .forgejo/workflows/test-and-publish.yml | 17 ++++------------- README.md | 8 +++----- docker-compose.yml | 2 +- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/.forgejo/workflows/test-and-publish.yml b/.forgejo/workflows/test-and-publish.yml index ba0f211..aade3f6 100644 --- a/.forgejo/workflows/test-and-publish.yml +++ b/.forgejo/workflows/test-and-publish.yml @@ -10,10 +10,7 @@ on: workflow_dispatch: env: - # Use the github container registry - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - + REGISTRY: forge.mdiluz.io jobs: @@ -41,12 +38,6 @@ jobs: build-and-push-images: runs-on: ubuntu-22.04 needs: test - - permissions: - contents: read - packages: write - attestations: write - id-token: write steps: - name: Checkout repository @@ -56,8 +47,8 @@ jobs: uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 with: registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GH_PAT }} + username: ${{ env.GITHUB_ACTOR }} + password: ${{ secrets.PACKAGE_PAT }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -66,7 +57,7 @@ jobs: id: meta uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + images: ${{ env.REGISTRY }}/${{ env.GITHUB_REPOSITORY }} tags: | type=ref,event=tag type=ref,event=branch diff --git a/README.md b/README.md index 0690ced..023a14c 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,6 @@ Matchy is a Discord bot that groups up users for fun and vibes. Matchy can be in Note: Matchy currently only allows owner-authorised users to trigger posts in channels. -![Tests](https://github.com/mdiluz/matchy/actions/workflows/test.yml/badge.svg) - ## Commands Matchy supports a bunch of user, `matcher` and bot owner commands. `/` commands are available in any channel the bot has access to, and `$` commands are only available in DMs. @@ -35,7 +33,7 @@ Development has been on on Linux so far, but running on Mac or Windows _should_ ### Getting Started ```bash -git clone git@github.com:mdiluz/matchy.git +git clone https://forge.mdiluz.io/mdiluz/matchy.git cd matchy python -m venv .venv source .venv/bin/activate @@ -56,11 +54,11 @@ State is stored locally in a `.matchy/state.json` file. This will be created by The `TOKEN` envar is required run the bot. It's recommended this is placed in a local `.env` file. To generate bot token for development see [this discord.py guide](https://discordpy.readthedocs.io/en/stable/discord.html). ### Docker -Docker and Compose configs are provided, with the latest release tagged as `ghcr.io/mdiluz/matchy:latest`. A location for persistent data is stil required so some persistent volume will need to be mapped into the container as `/usr/share/app/.matchy`. +Docker and Compose configs are provided, with the latest release tagged as `forge.mdiluz.io/mdiluz/matchy:latest`. A location for persistent data is stil required so some persistent volume will need to be mapped into the container as `/usr/share/app/.matchy`. An example for how to do this may look like this: ```bash -docker run -v --env-file=.env ./.matchy:/usr/src/app/.matchy ghcr.io/mdiluz/matchy:latest +docker run -v --env-file=.env ./.matchy:/usr/src/app/.matchy forge.mdiluz.io/mdiluz/matchy:latest ``` A [`docker-compose.yml`](docker-compose.yml) file is also provided that essentially performs the above when used with `docker compose up --exit-code-from matchy`. A `MATCHY_DATA` envar can be used in conjunction with compose to set a custom local path for the location of the data file. diff --git a/docker-compose.yml b/docker-compose.yml index b4fa833..a908536 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: matchy: - image: ghcr.io/mdiluz/matchy:${MATCHY_TAG:-latest} + image: forge.mdiluz.io/mdiluz/matchy:${MATCHY_TAG:-latest} env_file: ".env" volumes: - ${MATCHY_DATA:-./.matchy}:/usr/src/app/.matchy \ No newline at end of file