- Fix checkout URLs in update-production-secrets.yml - Fix checkout URLs in security-scan.yml - Fix checkout URLs in test-registry.yml - Change from repository.michaelschiemer.de:5000 to git.michaelschiemer.de
62 lines
1.8 KiB
YAML
62 lines
1.8 KiB
YAML
name: Test Registry Credentials
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [ main ]
|
|
paths:
|
|
- 'scripts/test-registry-credentials.sh'
|
|
- '.gitea/workflows/test-registry.yml'
|
|
|
|
env:
|
|
REGISTRY_DOMAIN: registry.michaelschiemer.de
|
|
REGISTRY_HOST: 94.16.110.151
|
|
|
|
jobs:
|
|
test-credentials:
|
|
name: Test Registry Credentials
|
|
runs-on: docker-build
|
|
steps:
|
|
- name: Install git and setup environment
|
|
shell: sh
|
|
run: |
|
|
if ! command -v bash >/dev/null 2>&1 || ! command -v git >/dev/null 2>&1 || ! command -v curl >/dev/null 2>&1; then
|
|
apk add --no-cache git bash curl ca-certificates
|
|
fi
|
|
|
|
- name: Checkout code
|
|
shell: bash
|
|
run: |
|
|
REF_NAME="${{ github.ref_name }}"
|
|
REPO="${{ github.repository }}"
|
|
if [ -z "$REF_NAME" ]; then
|
|
REF_NAME="main"
|
|
fi
|
|
|
|
if [ -n "${{ secrets.CI_TOKEN }}" ]; then
|
|
git clone --depth 1 --branch "$REF_NAME" \
|
|
"https://${{ secrets.CI_TOKEN }}@git.michaelschiemer.de/${REPO}.git" \
|
|
/workspace/repo
|
|
else
|
|
git clone --depth 1 --branch "$REF_NAME" \
|
|
"https://git.michaelschiemer.de/${REPO}.git" \
|
|
/workspace/repo || \
|
|
git clone --depth 1 \
|
|
"https://git.michaelschiemer.de/${REPO}.git" \
|
|
/workspace/repo
|
|
fi
|
|
|
|
cd /workspace/repo
|
|
|
|
- name: Test Registry Credentials
|
|
shell: bash
|
|
env:
|
|
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
|
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
|
REGISTRY_DOMAIN: ${{ env.REGISTRY_DOMAIN }}
|
|
REGISTRY_HOST: ${{ env.REGISTRY_HOST }}
|
|
REGISTRY_PORT: 5000
|
|
run: |
|
|
cd /workspace/repo
|
|
./scripts/test-registry-credentials.sh
|