Skip to content

Commit

Permalink
Switch to new deployment method
Browse files Browse the repository at this point in the history
  • Loading branch information
cb1kenobi committed Jan 14, 2024
1 parent e250e7c commit e9ece60
Show file tree
Hide file tree
Showing 6 changed files with 483 additions and 7,228 deletions.
1 change: 0 additions & 1 deletion .buildpacks

This file was deleted.

8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.eslintrc.json
.git
.github
.gitignore
Dockerfile
LICENSE
tailwind.config.js
tsconfig.json
44 changes: 33 additions & 11 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,53 @@
---
name: 'deploy'
name: 'Deploy'

# yamllint disable-line rule:truthy
on:
push:
branches:
- main
repository_dispatch:
types: [ deploy ]
workflow_dispatch:

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-latest
steps:
# third-party action that cancels previous runs
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Cloning repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: tidev/tidev.io

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to private registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.TIDEV_REGISTRY_URL }}
username: ${{ secrets.TIDEV_REGISTRY_USERNAME }}
password: ${{ secrets.TIDEV_REGISTRY_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ secrets.TIDEV_REGISTRY_URL }}/${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Push to dokku
uses: dokku/github-action@master
with:
branch: 'main'
deploy_docker_image: ${{ secrets.TIDEV_REGISTRY_URL }}/${{ steps.meta.outputs.tags }}
git_push_flags: '--force'
git_remote_url: 'ssh://[email protected]:22/tidev.io'
ssh_private_key: ${{ secrets.DO_SSH_PRIVATE_KEY }}
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:20-alpine

WORKDIR /app
COPY . /app

RUN corepack enable && \
pnpm install --frozen-lockfile && \
pnpm run build

ENV NODE_ENV production
EXPOSE 80/tcp
CMD [ "pnpm", "start" ]
Loading

0 comments on commit e9ece60

Please sign in to comment.