Working base server with migrations and build steps ironed out #1

Merged
joseph.nelson4456 merged 24 commits from base-setup into main 2026-05-13 23:16:22 -07:00
3 changed files with 16 additions and 4 deletions
Showing only changes of commit d47633b638 - Show all commits
+14 -1
View File
@@ -9,17 +9,30 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Log in to Gitea Registry
uses: docker/login-action@v2
with:
registry: gitea.nelson-household.com # Replace with your Gitea domain
username: ${{ gitea.actor }}
password: ${{ secrets.RUNNER_TOKEN }}
- name: Delete Old Images and Containers
run: |
docker ps -a -q -f "name=tcg-collectors-server" | xargs -I {} docker rm {} || true
docker images --format "{{.Repository}}:{{.Tag}}" | grep "tcg-collectors-server" | xargs -I {} docker rmi {} || true
- name: Build and Push Image
run: |
docker build -t gitea.nelson-household.com/hard-at-work/tcg-collectors-server/tcg-collectors-server:${{ github.sha }} .
docker build \
--build-arg DB_HOST=${{ secrets.DB_HOST }} \
--build-arg DB_USERNAME=${{ secrets.DB_USERNAME }} \
--build-arg DB_PASSWORD=${{ secrets.DB_PASSWORD }} \
--build-arg DB_PORT=${{ secrets.DB_PORT }} \
--build-arg DB_DATABASE=${{ secrets.DB_DATABASE }} \
-t gitea.nelson-household.com/hard-at-work/tcg-collectors-server/tcg-collectors-server:${{ github.sha }} .
docker push gitea.nelson-household.com/hard-at-work/tcg-collectors-server/tcg-collectors-server:${{ github.sha }}
- name: Execute Migrations
run: |
docker exec gitea.nelson-household.com/hard-at-work/tcg-collectors-server/tcg-collectors-server:${{ github.sha }} npm run migrate
+1 -2
View File
@@ -6,9 +6,8 @@ ENV DB_PASSWORD=<your_db_password>
ENV DB_PORT=<your_db_port>
ENV DB_DATABASE=<your_db_database>
ARG CMD
WORKDIR /app
COPY . .
RUN npm install --force
CMD ["node", "run", "$CMD"]
CMD ["npm", "run", "start"]
+1 -1
View File
@@ -9,7 +9,7 @@
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "prettier --config prettier.config.js --write .",
"migrations": "node ./migrations/index.js"
"migrate": "node ./migrations/index.js"
},
"type": "module",
"keywords": [