diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index 534afa7e9..474834448 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -3,31 +3,36 @@ on: push: branches: - main + - marcus/ghcr +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} jobs: build: runs-on: ubuntu-latest steps: - name: Check Out Repo uses: actions/checkout@v4 - - name: Login to Docker Hub - uses: docker/login-action@v3 + - name: Login to registry + uses: "docker/login-action@v2.1.0" with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + registry: ${{ env.REGISTRY }} + password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ github.actor }} - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - name: Build and push - id: docker_build - uses: docker/build-push-action@v5 + uses: docker/setup-buildx-action@v2 + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4.3.0 with: - context: ./ - file: ./Dockerfile - provenance: false + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Build and push Docker image + uses: docker/build-push-action@v4.0.0 + with: + context: . + platforms: linux/amd64,linux/arm64 push: true - platforms: linux/amd64 - tags: "${{ secrets.DOCKER_HUB_PREFIX }}/convos:alpha" - - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} + tags: gchr.io/convos-chat/convos:alpha + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index daddec620..d2ee964e6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -3,6 +3,9 @@ on: push: tags: - v*.* +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} jobs: build: runs-on: ubuntu-latest @@ -17,11 +20,12 @@ jobs: echo '::set-output name=tag::'$TAG_NAME - name: Check Out Repo uses: actions/checkout@v4 - - name: Login to Docker Hub - uses: docker/login-action@v3 + - name: Login to registry + uses: "docker/login-action@v2.1.0" with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + registry: ${{ env.REGISTRY }} + password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ github.actor }} - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx @@ -35,6 +39,6 @@ jobs: file: ./Dockerfile push: true platforms: linux/amd64,linux/arm64 - tags: "${{ secrets.DOCKER_HUB_PREFIX }}/convos:stable,${{ steps.calculate_tag.outputs.tag }}" + tags: ghcr.io/convos-chat/convos:stable,${{ steps.calculate_tag.outputs.tag }}" - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/Dockerfile b/Dockerfile index a8f21d3c2..febd725ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ # # BUILD: docker build --no-cache --rm -t convos/convos . # RUN: docker run -it --rm -p 8080:3000 -v /var/convos/data:/data convos/convos -FROM convos/convos:base +FROM ghcr.io/convos-chat/convos-base:main LABEL maintainer="jhthorsen@cpan.org" RUN mkdir /app @@ -17,10 +17,10 @@ COPY templates /app/templates ENV CONVOS_DEPENDENCIES all RUN apk add --no-cache curl openssl perl perl-io-socket-ssl perl-net-ssleay wget && \ - apk add --no-cache --virtual builddeps build-base perl-dev && \ - /app/script/convos install --all && \ - apk del builddeps && \ - rm -rf /root/.cpanm /var/cache/apk/* + apk add --no-cache --virtual builddeps build-base perl-dev && \ + /app/script/convos install --all && \ + apk del builddeps && \ + rm -rf /root/.cpanm /var/cache/apk/* # Do not change these variables unless you know what you're doing ENV CONVOS_HOME /data