updated build file, package file, and dockerfile
Build and Push Image / build-and-push (push) Failing after 1m30s
Build and Push Image / build-and-push (push) Failing after 1m30s
This commit is contained in:
@@ -9,17 +9,30 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Log in to Gitea Registry
|
- name: Log in to Gitea Registry
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
registry: gitea.nelson-household.com # Replace with your Gitea domain
|
registry: gitea.nelson-household.com # Replace with your Gitea domain
|
||||||
username: ${{ gitea.actor }}
|
username: ${{ gitea.actor }}
|
||||||
password: ${{ secrets.RUNNER_TOKEN }}
|
password: ${{ secrets.RUNNER_TOKEN }}
|
||||||
|
|
||||||
- name: Delete Old Images and Containers
|
- name: Delete Old Images and Containers
|
||||||
run: |
|
run: |
|
||||||
docker ps -a -q -f "name=tcg-collectors-server" | xargs -I {} docker rm {} || true
|
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
|
docker images --format "{{.Repository}}:{{.Tag}}" | grep "tcg-collectors-server" | xargs -I {} docker rmi {} || true
|
||||||
|
|
||||||
- name: Build and Push Image
|
- name: Build and Push Image
|
||||||
run: |
|
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 }}
|
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
@@ -6,9 +6,8 @@ ENV DB_PASSWORD=<your_db_password>
|
|||||||
ENV DB_PORT=<your_db_port>
|
ENV DB_PORT=<your_db_port>
|
||||||
ENV DB_DATABASE=<your_db_database>
|
ENV DB_DATABASE=<your_db_database>
|
||||||
|
|
||||||
ARG CMD
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN npm install --force
|
RUN npm install --force
|
||||||
|
|
||||||
CMD ["node", "run", "$CMD"]
|
CMD ["npm", "run", "start"]
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@
|
|||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"lint:fix": "eslint . --fix",
|
"lint:fix": "eslint . --fix",
|
||||||
"format": "prettier --config prettier.config.js --write .",
|
"format": "prettier --config prettier.config.js --write .",
|
||||||
"migrations": "node ./migrations/index.js"
|
"migrate": "node ./migrations/index.js"
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|||||||
Reference in New Issue
Block a user