diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index b1dad8f..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: CI - -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - server: - name: Server — typecheck & build - runs-on: ubuntu-latest - defaults: - run: - working-directory: server - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: npm - cache-dependency-path: server/package-lock.json - - - name: Install dependencies - run: npm ci - - - name: Generate Prisma client - run: npx prisma generate - - - name: Typecheck - run: npx tsc --noEmit - - - name: Build - run: npm run build - - client: - name: Client — typecheck & build - runs-on: ubuntu-latest - defaults: - run: - working-directory: client - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: npm - cache-dependency-path: client/package-lock.json - - - name: Install dependencies - run: npm ci - - - name: Typecheck - run: npx tsc --noEmit - - - name: Build - run: npm run build - - docker: - name: Docker build (smoke test) - runs-on: ubuntu-latest - needs: [server, client] - - steps: - - uses: actions/checkout@v4 - - - name: Build image - run: | - docker build \ - --build-arg NODE_ENV=production \ - -t vendor-pos:ci . diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 0000000..3d499eb --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,25 @@ +name: Build and Push Docker Image +on: + push: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + container: + image: catthehacker/ubuntu:act-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Log in to Gitea Container Registry + uses: docker/login-action@v3 + with: + registry: registry.alwisp.com + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_TOKEN }} + + - name: Build and Push + run: | + docker build -t registry.alwisp.com/${{ gitea.repository_owner }}/${{ gitea.repository }}:latest . + docker push registry.alwisp.com/${{ gitea.repository_owner }}/${{ gitea.repository }}:latest \ No newline at end of file