Skip to content

Commit

Permalink
build: switch to new deploy method
Browse files Browse the repository at this point in the history
  • Loading branch information
cb1kenobi committed Jan 14, 2024
1 parent 9e4d8ba commit 7e948d6
Show file tree
Hide file tree
Showing 7 changed files with 9,351 additions and 7,718 deletions.
1 change: 0 additions & 1 deletion .buildpacks

This file was deleted.

11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.eslintrc.json
.husky
.git
.github
.gitignore
.turbo
.vscode
Dockerfile
LICENSE
tsconfig.json
tsconfig.tsbuildinfo
41 changes: 31 additions & 10 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
name: 'Deploy'

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

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

env:
NEXT_PUBLIC_GITHUB_ACCESS_TOKEN: ${{ secrets.NEXT_PUBLIC_GITHUB_ACCESS_TOKEN }}
Expand All @@ -16,20 +19,38 @@ 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/modules.titaniumsdk.com

- 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/modules.titaniumsdk.com'
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 7e948d6

Please sign in to comment.