name: Build and Push Postgres Docker Image on: push: branches: - main paths: - "crates/xataid-extension/**" - ".github/workflows/docker-build-and-push-postgres.yml" jobs: build-and-push: runs-on: ubuntu-latest permissions: contents: read packages: write steps: - name: Checkout repository uses: actions/checkout@v4 - name: Log in to Docker uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - name: Build and Publish image to Docker Hub uses: fluentci-io/setup-fluentci@v5 with: wasm: true plugin: buildx args: | build_cloud --platform linux/amd64,linux/arm64 -t tsiry/postgres-xataid:latest crates/xataid-extension "--build-arg GITHUB_TOKEN=\"${GITHUB_ACCESS_TOKEN}\"" --push env: GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} BUILDX_BUILDER: tsiry/rockbox-builder - name: Log in to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Publish to Github Container Registry run: | docker pull tsiry/postgres-xataid:latest docker tag tsiry/postgres-xataid:latest ghcr.io/tsirysndr/postgres-xataid:${{ github.sha }} docker tag tsiry/postgres-xataid:latest ghcr.io/tsirysndr/postgres-xataid:latest docker push ghcr.io/tsirysndr/postgres-xataid:latest