Skip to content

Commit 47080e6

Browse files
ci: new release flow
1 parent ad6826e commit 47080e6

File tree

3 files changed

+43
-5
lines changed

3 files changed

+43
-5
lines changed

.github/workflows/publish.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Production deployment
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout the repo
12+
uses: actions/checkout@v2
13+
14+
- name: Log in to Docker Hub
15+
uses: docker/login-action@v3
16+
with:
17+
username: ${{ secrets.DOCKER_USERNAME }}
18+
password: ${{ secrets.DOCKER_PASSWORD }}
19+
- name: Extract metadata (tags, labels) for Docker
20+
id: meta
21+
uses: docker/metadata-action@v5
22+
with:
23+
images: appwrite/console
24+
- name: Build and push Docker image
25+
id: push
26+
uses: docker/build-push-action@v6
27+
with:
28+
context: .
29+
file: ./Dockerfile
30+
push: true
31+
tags: ${{ steps.meta.outputs.tags }}
32+
labels: ${{ steps.meta.outputs.labels }}
33+
build-args: |
34+
"VITE_CONSOLE_MODE=self-hosted""
35+
"VITE_APPWRITE_GROWTH_ENDPOINT=${{ vars.VITE_APPWRITE_GROWTH_ENDPOINT }}"

Dockerfile

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
FROM node:20-alpine as build
22

3+
WORKDIR /app
4+
35
ENV PNPM_HOME="/pnpm"
46
ENV PATH="$PNPM_HOME:$PATH"
57
RUN corepack enable
6-
WORKDIR /app
8+
9+
ADD ./package.json /app/package.json
10+
ADD ./pnpm-lock.yaml /app/pnpm-lock.yaml
11+
12+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
713

814
ADD ./build.js /app/build.js
915
ADD ./tsconfig.json /app/tsconfig.json
1016
ADD ./svelte.config.js /app/svelte.config.js
1117
ADD ./vite.config.ts /app/vite.config.ts
12-
ADD ./package.json /app/package.json
13-
ADD ./pnpm-lock.yaml /app/pnpm-lock.yaml
1418
ADD ./src /app/src
1519
ADD ./static /app/static
1620

@@ -24,7 +28,6 @@ ENV VITE_APPWRITE_GROWTH_ENDPOINT=$VITE_APPWRITE_GROWTH_ENDPOINT
2428
ENV VITE_CONSOLE_MODE=$VITE_CONSOLE_MODE
2529
ENV VITE_STRIPE_PUBLIC_KEY=$VITE_STRIPE_PUBLIC_KEY
2630

27-
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
2831
RUN pnpm run sync && pnpm run build
2932

3033
FROM nginx:1.25-alpine

compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ services:
2323
- VITE_APPWRITE_GROWTH_ENDPOINT
2424
- VITE_STRIPE_PUBLIC_KEY
2525
ports:
26-
- '3000:3000'
26+
- '3000:80'

0 commit comments

Comments
 (0)