From ab01290b72fc0036d076573ce6222560ebfda40b Mon Sep 17 00:00:00 2001 From: Jonathan Cremin Date: Sun, 15 Jun 2025 19:03:03 +0100 Subject: [PATCH] Use Docker instead of Podman for now --- .forgejo/workflows/.env | 12 +++++++++++ .forgejo/workflows/ci.yml | 44 ++++++++++----------------------------- 2 files changed, 23 insertions(+), 33 deletions(-) create mode 100644 .forgejo/workflows/.env diff --git a/.forgejo/workflows/.env b/.forgejo/workflows/.env new file mode 100644 index 0000000..0c2f98d --- /dev/null +++ b/.forgejo/workflows/.env @@ -0,0 +1,12 @@ +WEB_BASE_URL=http://localhost:3000 +API_BASE_URL=http://localhost:3000/api +UPLOAD_STORAGE_PATH=/hostr/uploads +COOKIE_KEY=TESTING +EMAIL_FROM=jonathan@hostr.co +EMAIL_NAME="Jonathan from Hostr" +DATABASE_URL=postgresql://hostr:hostr@database:5432/hostr +REDIS_URL=redis://redis:6379 +AWS_ENDPOINT=http://minio:9000 +AWS_ACCESS_KEY_ID=7HYV3KPRGQ8Z5YCDNWC6 +AWS_SECRET_ACCESS_KEY=0kWP/ZkgIwQzgL9t4SGv9Uc93rO//OdyqMH329b/ +AWS_BUCKET=hostr diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index a76d0c2..b1c0994 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -14,34 +14,25 @@ jobs: run: echo "NOW=$(date +'%Y%m%d-%H%M%S')" >> $GITHUB_ENV - name: Fix for bad os check run: echo "RUNNER_OS=Linux" >> $GITHUB_ENV - - name: Login to Forgejo Registry - uses: https://cremin.dev/actions/podman-login@v1 + - name: Login to Docker Hub + uses: https://cremin.dev/actions/docker-login@v3 with: registry: cremin.dev username: ${{ github.actor }} password: ${{ secrets.FORGEJO_REGISTRY_TOKEN }} - logout: false - name: Check out repository uses: https://cremin.dev/actions/checkout@v4 - - name: Build image - uses: https://cremin.dev/actions/buildah-build@v2 + - name: Set up Docker Buildx + uses: https://cremin.dev/actions/docker-setup-buildx@v3 + - name: Build and push + uses: https://cremin.dev/actions/docker-build-push@v6 with: - containerfiles: ./Containerfile + file: ./Containerfile context: ./ - oci: true - layers: true - image: cremin.dev/jonathan/hostr - tags: latest ${{ github.sha }} - - name: Push image - uses: https://cremin.dev/actions/push-to-registry@v2 - with: - registry: cremin.dev - username: ${{ github.actor }} - password: ${{ secrets.FORGEJO_REGISTRY_TOKEN }} - image: jonathan/hostr - tags: latest ${{ github.sha }} + tags: cremin.dev/jonathan/hostr:latest,cremin.dev/jonathan/hostr:${{ github.sha }} + push: true test-image: - runs-on: self-hosted + runs-on: node22 needs: build-image services: database: @@ -62,18 +53,5 @@ jobs: - name: Check out repository uses: https://cremin.dev/actions/checkout@v4 - name: Test image - env: - WEB_BASE_URL: http://localhost:3000 - API_BASE_URL: http://localhost:3000/api - UPLOAD_STORAGE_PATH: /hostr/uploads - COOKIE_KEY: TESTING - EMAIL_FROM: jonathan@hostr.co - EMAIL_NAME: "Jonathan from Hostr" - DATABASE_URL: postgresql://hostr:hostr@database:5432/hostr - REDIS_URL: redis://redis:6379 - AWS_ENDPOINT: http://minio:9000 - AWS_ACCESS_KEY_ID: 7HYV3KPRGQ8Z5YCDNWC6 - AWS_SECRET_ACCESS_KEY: 0kWP/ZkgIwQzgL9t4SGv9Uc93rO//OdyqMH329b/ - AWS_BUCKET: hostr run: | - podman run --rm --env-host -it cremin.dev/jonathan/hostr:${{ github.sha }} yarn test + docker run --env-file ./.forgejo/workflows/.env --rm -it cremin.dev/jonathan/hostr:${{ github.sha }} yarn test