Skip to content

Commit

Permalink
🚀 chore(.github/workflows/postgres-build.yml): Update GitHub Action…
Browse files Browse the repository at this point in the history
…s workflow for Docker image builds and registry login.
  • Loading branch information
vnobo committed Dec 12, 2024
1 parent 5675c6e commit c894d23
Showing 1 changed file with 15 additions and 38 deletions.
53 changes: 15 additions & 38 deletions .github/workflows/postgres-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,51 +27,28 @@ jobs:
attestations: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

- name: Docker Setup Buildx
# You may pin to the exact commit or the version.
# uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349
uses: docker/[email protected]
#with:
# Buildx version. (eg. v0.3.0)
#version: # optional
# Sets the builder driver to be used
#driver: # optional, default is docker-container
# List of additional driver-specific options. (eg. image=moby/buildkit:master)
#driver-opts: # optional
# BuildKit daemon flags
#buildkitd-flags: # optional
# BuildKit daemon config file
#buildkitd-config: # optional
# Inline BuildKit daemon config
#buildkitd-config-inline: # optional
# Sets up docker build command as an alias to docker buildx build
#install: # optional, default is false
# Switch to this builder instance
#use: # optional, default is true
# Optional address for docker socket or context from `docker context ls`
#endpoint: # optional
# Fixed platforms for current node. If not empty, values take priority over the detected ones
#platforms: # optional
# Append additional nodes to the builder
#append: # optional
# Cache buildx binary to GitHub Actions cache backend
#cache-binary: # optional, default is true
# Cleanup temp files and remove builder at the end of a job
#cleanup: # optional, default is true
# BuildKit daemon config file
#config: # optional
# Inline BuildKit daemon config
#config-inline: # optional

- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build Local Docker image
run: docker buildx build -t ${{ vars.DOCKER_PREFIX }}/postgres:17 ./boot/postgres
run: docker buildx build --push -t ${{ vars.DOCKER_PREFIX }}/postgres:17 ./boot/postgres

- name: Build zhparser Docker image
run: docker buildx build -t ${{ vars.DOCKER_PREFIX }}/postgres:zhparser ./boot/postgres/zhparser
run: docker buildx build --push -t ${{ vars.DOCKER_PREFIX }}/postgres:zhparser ./boot/postgres/zhparser

- name: Build postgis Docker image
run: docker buildx build -t ${{ vars.DOCKER_PREFIX }}/postgres:postgis ./boot/postgres/postgis
run: docker buildx build --push -t ${{ vars.DOCKER_PREFIX }}/postgres:postgis ./boot/postgres/postgis

- name: Build latest Docker image
run: docker buildx build -t ${{ vars.DOCKER_PREFIX }}/postgres:latest ./boot/postgres/postgis
run: docker buildx build --push -t ${{ vars.DOCKER_PREFIX }}/postgres:latest ./boot/postgres/postgis

0 comments on commit c894d23

Please sign in to comment.