Skip to content

Commit

Permalink
fix: release version is displayed in the UI (#118)
Browse files Browse the repository at this point in the history
- Updates `package.json` with the version output of `semantic-release`
- Builds release for Cloudflare Pages and deploys it
- Builds Docker image and publishes it to GH's registry
  • Loading branch information
fmaclen authored Jul 26, 2024
1 parent 2f8b4cb commit 3664d00
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 17 deletions.
49 changes: 33 additions & 16 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}

docker:
cloudflare:
name: CloudFlare Pages
needs: release
if: ${{ needs.release.outputs.new_release_published == 'true' }}

name: Build & publish
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -42,22 +41,40 @@ jobs:
- name: Update app version in package.json
run: node .github/workflows/publish/update-package-json.cjs ${{ needs.release.outputs.new_release_version }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run build

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
command: pages publish .svelte-kit/cloudflare --project-name hollama

docker:
needs: release
if: ${{ needs.release.outputs.new_release_published == 'true' }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
name: Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Update app version in package.json
run: node .github/workflows/publish/update-package-json.cjs ${{ needs.release.outputs.new_release_version }}

- name: Build & publish
uses: mr-smithers-excellent/docker-build-push@v6
with:
image: hollama
registry: ghcr.io
multiPlatform: true
platform: linux/amd64,linux/arm64
tags: latest, ${{ needs.release.outputs.new_release_version }}
username: ${{ secrets.GH_REGISTRY_USERNAME }}
password: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}

- name: Push the Docker image
uses: docker/build-push-action@v5
with:
push: true
tags: ghcr.io/${{ secrets.GH_REGISTRY_USERNAME }}/hollama:latest, ghcr.io/${{ secrets.GH_REGISTRY_USERNAME }}/hollama:${{ needs.release.outputs.new_release_version }}
platforms: linux/arm64, linux/amd64
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM node:20-alpine

WORKDIR /app

ENV ADAPTER 'docker-node'
ENV ADAPTER='docker-node'

COPY . .

Expand Down

0 comments on commit 3664d00

Please sign in to comment.