File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed
Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Push Docker Image
2+
3+ on :
4+ # Run workflow on push events to the main branch
5+ push :
6+ branches : [ main ]
7+
8+ jobs :
9+ build-and-push :
10+ runs-on : ubuntu-latest # Replace with your preferred runner
11+
12+ steps :
13+ - name : Checkout code
14+ uses : actions/checkout@v3 # Fetches code from your repository
15+
16+ - name : Login to Docker Hub (using secrets)
17+ uses : docker/login-action@v2 # Official Docker login action
18+ with :
19+ username : ${{ secrets.DOCKERHUB_USERNAME }}
20+ password : ${{ secrets.DOCKERHUB_TOKEN }}
21+
22+ - name : Set up Docker Buildx (optional for multi-platform builds)
23+ uses : docker/setup-buildx-action@v3 # Optional for multi-arch builds
24+
25+ - name : Build Docker image (using build args)
26+ uses : docker/build-push-action@v5 # Official Docker build and push action
27+ with :
28+ push : true # Push image to Docker Hub
29+ tags : ${{ secrets.DOCKERHUB_USERNAME }}/pg-custom:0.5.0 # Replace with your desired tag
30+ context : .
31+ platforms : linux/amd64,linux/arm64
32+ build-args : | # Pass environment variables to build process
33+ POSTGRES_VERSION=15
Original file line number Diff line number Diff line change 1+ ARG POSTGRES_VERSION
2+ FROM postgres:$POSTGRES_VERSION
3+
4+ RUN apt-get update && \
5+ apt-get install -y git make gcc
6+
7+ RUN git clone https://github.com/pgpartman/pg_partman --branch 4.7.1
8+ RUN cd pg_partman && make NO_BGW=1 install
9+
10+ RUN apt-get update && \
11+ apt-get -y install postgresql-15-cron && \
12+ apt-get clean \
13+ && rm -rf /var/lib/apt/lists/*
You can’t perform that action at this time.
0 commit comments