Skip to content

Commit

Permalink
v2
Browse files Browse the repository at this point in the history
  • Loading branch information
mo9a7i committed Sep 24, 2023
1 parent 2c93ce1 commit 28b2506
Show file tree
Hide file tree
Showing 22 changed files with 4,358 additions and 9,622 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
54 changes: 54 additions & 0 deletions .github/workflows/deploy-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Create and publish a Docker image

on:
push:
branches:
- main
pull_request:
branches:
- main

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repo
uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Log in to the container registery
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: latest=true
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.DS_Store

archive
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

Expand Down Expand Up @@ -107,3 +107,4 @@ dist

config.json
secret_notes.js
dump.json
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# foursquare_bot

## 2.0.0

### Major Changes

- Docker Image, NPM 18, PNPM and more..

- docker compose takes an image now.
- Docker file
- `FROM node:18.0.0-alpine3.13`
- PNPM
- development and production separation
- Modulrizing the sciprt, separating config, firebase
- Adding chalk

## 1.0.2

### Minor Changes

- Typescript and PNPM
36 changes: 28 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,34 @@
FROM node:16
FROM node:18.9.0-alpine as development

# install curl & pnpm
RUN apk add --no-cache curl
RUN curl -sL https://unpkg.com/@pnpm/self-installer | node
RUN apk del curl

WORKDIR /usr/src/app

COPY ./pnpm-lock.yaml ./

RUN pnpm install

COPY ./src ./src

RUN pnpm build


FROM node:18.9.0-alpine as production

# install curl & pnpm
RUN apk add --no-cache curl
RUN curl -sL https://unpkg.com/@pnpm/self-installer | node
RUN apk del curl

# Create app directory
WORKDIR /usr/src/app

# Install app dependencies
COPY ./src/package*.json ./
COPY ./pnpm-lock.yaml ./

RUN npm install
RUN pnpm install --prod --frozen-lockfile

# If you are building your code for production
COPY ./src .
COPY --from=development /usr/src/app/dist ./dist

CMD [ "node", "index.js" ]
CMD ["pnpm", "start"]

0 comments on commit 28b2506

Please sign in to comment.