Skip to content

Commit

Permalink
[#] test sns-process pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhongFuze committed Oct 22, 2024
1 parent 0e62dfa commit c18eeaa
Show file tree
Hide file tree
Showing 15 changed files with 2,221 additions and 7 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/sns_process.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build sns-process-image

on:
push:
branches:
- main

jobs:
build-image:
runs-on: ubuntu-latest
env:
REGISTRY: ghcr.io
IMAGE_NAME: web3bio/sns-process
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Docker BuildX
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-docker-build-${{ hashFiles('**/requirements.txt') }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: "./sns_process"
file: "./sns_process/Dockerfile"
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Clean up post-build cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ data
.env
.history
src/config/*.toml
!src/config/main.sample.toml
!src/config/main.sample.toml
sns_process/node_modules/
5 changes: 5 additions & 0 deletions sns_process/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/.dockerignore
/Dockerfile
/node_modules
/package-lock.json
/.env
20 changes: 20 additions & 0 deletions sns_process/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# hhttps://hub.docker.com/_/node
FROM node:22

LABEL maintainer="Zella Zhong <[email protected]>"

RUN apt-get update -y && \
apt-get upgrade -y --force-yes && \
apt-get install -y --force-yes supervisor

WORKDIR /node_app

COPY package*.json ./

RUN npm install -g npm@10

RUN npm install --only=production

COPY . .

ENTRYPOINT ["./run.sh"]
8 changes: 8 additions & 0 deletions sns_process/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
server:
image: ghcr.io/web3bio/data_process:main
container_name: data_process
volumes:
- ~/sns_process:/node_app/data
- ~/sns_process/.env:/node_app/.env
- ~/sns_process/log:/tmp
Loading

0 comments on commit c18eeaa

Please sign in to comment.