Update: Verwende repository.michaelschiemer.de:5000 für Git-Repository URLs
- Ändere Remote-URL zu repository.michaelschiemer.de:5000 - Aktualisiere alle Workflows (production-deploy, test-registry, security-scan, update-production-secrets) - Test: Production Deployment Workflow
This commit is contained in:
@@ -14,18 +14,34 @@ env:
|
||||
jobs:
|
||||
deploy-secrets:
|
||||
name: Deploy Secrets to Production
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: php-ci # Uses pre-built PHP 8.5 CI image with Ansible
|
||||
environment:
|
||||
name: production-secrets
|
||||
url: https://michaelschiemer.de
|
||||
|
||||
steps:
|
||||
- name: Checkout deployment configuration
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
sparse-checkout: |
|
||||
deployment/ansible
|
||||
sparse-checkout-cone-mode: false
|
||||
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 }}@repository.michaelschiemer.de:5000/${REPO}.git" \
|
||||
/workspace/repo
|
||||
else
|
||||
git clone --depth 1 --branch "$REF_NAME" \
|
||||
"https://repository.michaelschiemer.de:5000/${REPO}.git" \
|
||||
/workspace/repo || \
|
||||
git clone --depth 1 \
|
||||
"https://repository.michaelschiemer.de:5000/${REPO}.git" \
|
||||
/workspace/repo
|
||||
fi
|
||||
|
||||
cd /workspace/repo
|
||||
|
||||
- name: Setup SSH key
|
||||
run: |
|
||||
@@ -34,10 +50,9 @@ jobs:
|
||||
chmod 600 ~/.ssh/production
|
||||
ssh-keyscan -H ${{ env.DEPLOYMENT_HOST }} >> ~/.ssh/known_hosts
|
||||
|
||||
- name: Install Ansible
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ansible
|
||||
# Ansible is pre-installed in php-ci image
|
||||
- name: Verify Ansible installation
|
||||
run: ansible --version
|
||||
|
||||
- name: Create vault password file
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user