Skip to content

Fixed docker authentication #19

Fixed docker authentication

Fixed docker authentication #19

Workflow file for this run

name: "Build the images, also push them if merged on main"
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 90
strategy:
max-parallel: 9
matrix:
target:
- { directory: rhel, label: "🐧 Glibc build images" }
- { directory: musl, label: "🐧 Musl (dynamic) build images" }
- { directory: linux-static, label: "🐧 Musl (static) build images" }
- { directory: cross, label: "πŸ¦€πŸπŸ–₯️ Cross compilation images" }
- { directory: test, label: "πŸ¦€ Test image" }
- { directory: release, label: "πŸ¦€ Release image" }
- { directory: sql_server, label: "πŸ›’οΈ SQL Server images" }
- { directory: mongo, label: "πŸƒ Mongo single-replica images" }
- { directory: cockroach, label: "πŸͺ³ CockroachDB custom images" }
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
- name: "Build ${{matrix.target.label}}"
run: |
echo "Building ${{matrix.target.label}}"
cd "${{matrix.target.directory}}"
make build
push:
if: github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
timeout-minutes: 90
strategy:
max-parallel: 9
matrix:
target:
- { directory: rhel, label: "🐧 Glibc build images" }
- { directory: musl, label: "🐧 Musl (dynamic) build images" }
- { directory: linux-static, label: "🐧 Musl (static) build images" }
- { directory: cross, label: "πŸ¦€πŸπŸ–₯️ Cross compilation images" }
- { directory: test, label: "πŸ¦€ Test image" }
- { directory: release, label: "πŸ¦€ Release image" }
- { directory: sql_server, label: "πŸ›’οΈ SQL Server images" }
- { directory: mongo, label: "πŸƒ Mongo single-replica images" }
- { directory: cockroach, label: "πŸͺ³ CockroachDB custom images" }
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
- name: "Build and push ${{matrix.target.label}}"
env:
DOCKER_HUB_USERNAME: ${{vars.DOCKER_HUB_USERNAME}}
DOCKER_HUB_TOKEN: ${{secrets.DOCKER_HUB_TOKEN}}
run: |
echo "Building and pushing ${{matrix.target.label}}"
cd "${{matrix.target.directory}}"
make build
echo "$DOCKER_HUB_TOKEN" | docker login --username "$DOCKER_HUB_USERNAME" --password-stdin
make push