Files
tcg-collectors-server/.gitea/workflows/build.yaml
T
joseph.nelson4456 f6ff2ee69b
Build and Push Image / build-and-push (push) Failing after 1m35s
did not save up
2026-05-12 23:34:12 -07:00

35 lines
1.3 KiB
YAML

name: Build and Push Image
on: [push]
jobs:
build-and-push:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
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 \
--build-arg DATABASE_URL=${{ secrets.DATABASE_URL }} \
-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 run gitea.nelson-household.com/hard-at-work/tcg-collectors-server/tcg-collectors-server:${{ github.sha }} npm run migrate up