Skip to content

Commit

Permalink
tsconfig dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyzzp committed Jun 6, 2024
1 parent 2918477 commit 9f72827
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 25 deletions.
52 changes: 32 additions & 20 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,41 @@ name: Docker Image CI

on:
push:
branches: [ "master" ]
branches: ["master"]

jobs:

build:

runs-on: ubuntu-latest

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

- name: Docker Login
uses: docker/[email protected]
with:
username: tonyzzp
password: ${{secrets.DOCKER_USER_PASSWORD}}

- name: docker build
run: docker build -t ${{vars.DOCKER_IMAGE_NAME}} .

- name: docker push
run: docker push ${{vars.DOCKER_IMAGE_NAME}}

- name: restart server
run: curl "http://a.veikr.com:8000/action/restartserver?x-token=${{secrets.SERVER_TOOLS_TOKEN}}&file=tonyzzp_avatar"
- name: checkout
uses: actions/checkout@v3

- name: Docker Login
uses: docker/[email protected]
with:
username: tonyzzp
password: ${{secrets.DOCKER_USER_PASSWORD}}

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

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
${{vars.DOCKER_IMAGE_NAME}}
platforms: linux/amd64,linux/arm64

- name: restart server
run: curl "http://a.veikr.com:8000/action/restartserver?x-token=${{secrets.SERVER_TOOLS_TOKEN}}&file=tonyzzp_avatar"
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM node:alpine
EXPOSE 80
COPY src /app/src
COPY src /app/
COPY package.json /app/
COPY pnpm-lock.yaml /app/
COPY tsconfig.json /app/
WORKDIR /app
RUN npm i -g pnpm && pnpm i && npx tsc
RUN npm i && npm run build
CMD [ "node", "/app/dist/main.js" ]
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"target": "ES6",
"module": "ES6",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": false,
"skipLibCheck": true,
"moduleResolution": "NodeNext",
"moduleResolution": "Node",
"outDir": "dist"
},
"ts-node": {
Expand Down

0 comments on commit 9f72827

Please sign in to comment.