Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Caprover #10389

Merged
merged 3 commits into from
Jun 30, 2024
Merged

Caprover #10389

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Deploy to Caprover

on:
registry_package:
types: [published]

jobs:
build-and-deploy:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- name: Deploy Image to CapRrover
uses: caprover/[email protected]
with:
server: "${{ secrets.CAPROVER_SERVER }}"
app: biodrop
token: "${{ secrets.CAPROVER_TOKEN }}"
image: ghcr.io/eddiehubcommunity/biodrop:latest
44 changes: 44 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish Docker image
on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: npm install and build
run: |
npm ci
npm run build
- uses: actions/upload-artifact@main
with:
name: artifacts
path: prod/
push_to_registry:
name: Push Docker image to GitHub Packages
needs: build
runs-on: ubuntu-latest
steps:
- name: check out the repo
uses: actions/checkout@v4
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
- name: version dockerfile
uses: docker/setup-buildx-action@v3
- name: log into GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: push to Github Container Registry
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
ghcr.io/eddiehubcommunity/biodrop:v${{ steps.package-version.outputs.current-version}}
ghcr.io/eddiehubcommunity/biodrop:latest
7 changes: 2 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
FROM node:18
LABEL org.opencontainers.image.source https://github.com/eddiehubcommunity/BioDrop

WORKDIR /usr/src/app

COPY package*.json ./
RUN npm install --omit=dev --ignore-scripts
RUN npm ci --omit=dev --ignore-scripts
COPY . .

RUN sed -i 's/0.0.0/'`npm pkg get version | tr -d '"'`'/g' config/app.json

RUN --mount=type=secret,id=MONGO,target=./.env npm run build
RUN npm run build

CMD ["npm", "start"]
Loading