Skip to content

Commit

Permalink
Build images to ghcr
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusramberg committed Sep 27, 2023
1 parent 509ca86 commit 1f12033
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 27 deletions.
39 changes: 22 additions & 17 deletions .github/workflows/alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
with:
context: ./
file: ./Dockerfile
provenance: false
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/[email protected]
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 }}
14 changes: 9 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on:
push:
tags:
- v*.*
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -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
Expand All @@ -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 }}
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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="[email protected]"

RUN mkdir /app
Expand All @@ -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
Expand Down

0 comments on commit 1f12033

Please sign in to comment.