File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Deploy Docker Image
2+
3+ on :
4+ push :
5+ tags :
6+ - ' *'
7+
8+ jobs :
9+ build_and_push :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout code
14+ uses : actions/checkout@v4
15+
16+ - name : Set up Docker Buildx
17+ uses : docker/setup-buildx-action@v2
18+
19+ - name : Docker Login
20+ uses : docker/login-action@v2
21+ with :
22+ registry : ghcr.io
23+ username : ${{ github.actor }}
24+ password : ${{ secrets.GHCR_TOKEN }}
25+
26+ - name : Setup node
27+ uses : actions/setup-node@v6
28+ with :
29+ node-version : 22
30+
31+ - name : NPM Setup
32+ run : npm i
33+
34+ - name : Build project
35+ run : npx npm run build
36+
37+ - name : Build & Push Image
38+ uses : docker/build-push-action@v4
39+ with :
40+ context : ${{ github.workspace }}
41+ push : true
42+ platforms : linux/arm64,linux/amd64
43+ tags : ghcr.io/tutorialwork/my-channel/server:${{ github.ref_name }}
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ ADD . /usr/src/app
1313
1414RUN npm run build
1515
16+ COPY init-entrypoint.sh /init-entrypoint.sh
17+
18+ ENTRYPOINT ["/init-entrypoint.sh" ]
19+
1620CMD [ "npm" , "run" , "start" ]
1721
1822EXPOSE 3000
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ export MYSQL_PASSWORD=" $( cat /run/secrets/MY_CHANNEL_MYSQL_PASSWORD) "
4+ export API_KEY=" $( cat /run/secrets/MY_CHANNEL_API_KEY) "
5+ export MJ_APIKEY_PUBLIC=" $( cat /run/secrets/MY_CHANNEL_MJ_APIKEY_PUBLIC) "
6+ export MJ_APIKEY_PRIVATE=" $( cat /run/secrets/MY_CHANNEL_MJ_APIKEY_PRIVATE) "
7+
8+ exec " $@ "
You can’t perform that action at this time.
0 commit comments