diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3d66279..e072aff5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -179,3 +179,39 @@ jobs: - name: Export build run: npx expo export --platform android --output-dir dist + + docker: + name: Build and push backend image + needs: + - backend + - migrations + - frontend + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + runs-on: [qiniu, ubuntu-24.04] + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push backend image + uses: docker/build-push-action@v6 + with: + context: ./backend + push: true + tags: | + ghcr.io/1024xengineer/timeflow-backend:latest + ghcr.io/1024xengineer/timeflow-backend:${{ github.sha }} + labels: | + org.opencontainers.image.source=https://github.com/${{ github.repository }} + org.opencontainers.image.revision=${{ github.sha }}