diff --git a/.github/workflows/patroni-citus-k8s.yaml b/.github/workflows/patroni-citus-k8s.yaml new file mode 100644 index 0000000..f0d8998 --- /dev/null +++ b/.github/workflows/patroni-citus-k8s.yaml @@ -0,0 +1,51 @@ +name: rophy/patroni-citus-k8s +on: + push: + paths: + - patroni-citus-k8s/** + pull_request: + paths: + - patroni-citus-k8s/** +jobs: + test: + if: github.ref != 'refs/heads/main' || github.event_name == 'pull_request' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: ./patroni-citus-k8s + dockerfile: ./patroni-citus-k8s/Dockerfile + push: false + build-and-push: + if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set variables + run: | + VER=$(cat patroni-citus-k8s/version.txt) + echo "VERSION=$VER" >> $GITHUB_ENV + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: ./patroni-citus-k8s + dockerfile: ./patroni-citus-k8s/Dockerfile + push: true + tags: rophy/patroni-citus-k8s:${{ env.VERSION }}