diff --git a/.github/workflows/publish-beta.yml b/.github/workflows/publish-beta.yml new file mode 100644 index 0000000..8ae2850 --- /dev/null +++ b/.github/workflows/publish-beta.yml @@ -0,0 +1,44 @@ +name: Publish to Docker (beta) + +on: + workflow_dispatch: + push: + branches: + - beta + +jobs: + build: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Extract repository name + run: | + repo_name="${GITHUB_REPOSITORY#*/}" + repo_name_lowercase=$(echo "$repo_name" | tr '[:upper:]' '[:lower:]') # convert to lowercase + echo "Repository name: $repo_name_lowercase" + echo "REPO_NAME=$repo_name_lowercase" >> $GITHUB_ENV + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile + push: true + tags: ghcr.io/${{ github.repository_owner }}/${{ env.REPO_NAME }}:beta diff --git a/Dockerfile b/Dockerfile index 6f748ac..15faab1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,23 @@ FROM postgres:17-alpine RUN apk add --no-cache aws-cli + +# Install dependencies for wal2json +RUN apk add --no-cache \ + build-base \ + git \ + postgresql-dev \ + clang \ + llvm + +# Clone the wal2json repository +RUN git clone https://github.com/eulerto/wal2json.git ./wal2json + +# Build and install wal2json +RUN cd /wal2json && \ + USE_PGXS=1 make && \ + USE_PGXS=1 make install + +# Clean up build dependencies +RUN apk del build-base git postgresql-dev clang llvm && \ + rm -rf ./wal2json