Skip to content

Commit

Permalink
build: add docker and release
Browse files Browse the repository at this point in the history
  • Loading branch information
acifani committed May 8, 2024
1 parent dc80eb4 commit 4924695
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build and deploy

on:
push:
branches: [main]

permissions:
packages: write

env:
IMAGE_NAME: ghcr.io/acifani/actual-rest-api:${{ github.sha }}

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

steps:
- uses: actions/checkout@v4

- uses: docker/setup-buildx-action@v3

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ env.IMAGE_NAME }}

- uses: caprover/deploy-from-github@v1.1.2
with:
server: '${{ secrets.CAPROVER_SERVER }}'
app: '${{ secrets.APP_NAME }}'
token: '${{ secrets.APP_TOKEN }}'
image: ${{ env.IMAGE_NAME }}
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:20-slim
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

WORKDIR /usr/src/app
COPY . /usr/src/app

RUN corepack enable && pnpm install

CMD ["pnpm", "start"]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "actual-to-csv",
"name": "actual-rest-api",
"version": "1.0.0",
"description": "",
"main": "dist/index.js",
Expand Down

0 comments on commit 4924695

Please sign in to comment.