52 lines
1.7 KiB
YAML
52 lines
1.7 KiB
YAML
name: Build and Push ApacheOIDC Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Login to Registry
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: eiche:3000
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Docker imageTags
|
|
run: |
|
|
REPOSITORY_LC=$(echo "${{ gitea.repository }}" | tr '[:upper:]' '[:lower:]')
|
|
echo "versioned: eiche:3000/${REPOSITORY_LC}:${GITHUB_RUN_NUMBER}"
|
|
echo "latest: eiche:3000/${REPOSITORY_LC}:latest"
|
|
|
|
- name: Build Docker Image
|
|
run: |
|
|
REPOSITORY_LC=$(echo "${{ gitea.repository }}" | tr '[:upper:]' '[:lower:]')
|
|
# Build the image with the commit hash tag
|
|
|
|
export DOCKER_CLI_EXPERIMENTAL=enabled;
|
|
docker buildx create --name boxitapache --config ./buildkitd.toml || true 2>/dev/null;
|
|
docker buildx use boxitapache;
|
|
docker buildx build \
|
|
--platform linux/arm64,linux/amd64 \
|
|
--tag eiche:3000/${REPOSITORY_LC}:${GITHUB_RUN_NUMBER} \
|
|
--push \
|
|
.;
|
|
|
|
# Tag the same image as "latest"
|
|
docker tag eiche:3000/${REPOSITORY_LC}:${GITHUB_RUN_NUMBER} eiche:3000/${REPOSITORY_LC}:latest
|
|
|
|
- name: Push Docker Images
|
|
run: |
|
|
REPOSITORY_LC=$(echo "${{ gitea.repository }}" | tr '[:upper:]' '[:lower:]')
|
|
docker push eiche:3000/${REPOSITORY_LC}:${GITHUB_RUN_NUMBER}
|
|
docker push eiche:3000/${REPOSITORY_LC}:latest
|
|
|
|
- name: Log out from registry
|
|
if: always()
|
|
run: docker logout eiche:3000 |