diff --git a/.github/workflows/build_and_push.yml b/.github/workflows/build_and_push.yml index 9b48b7a..40a19c0 100644 --- a/.github/workflows/build_and_push.yml +++ b/.github/workflows/build_and_push.yml @@ -2,18 +2,26 @@ name: Test Config and Artifact Mechanism on: workflow_dispatch: + inputs: + tag: + description: "Docker image tag" + required: true + default: "latest" + +env: + REGISTRY: ghcr.io jobs: - # Job 1: Creazione dei file di configurazione + create-config: runs-on: ubuntu-latest steps: - - name: Creazione della directory di configurazione + - name: Create config directory run: mkdir -p config - # Creazione del file principale di configurazione (.cfg) - - name: Creazione del file principale di configurazione (.cfg) + + - name: Create main config file (django.cfg) run: | echo "DEBUG=${{ secrets.DEBUG }}" >> config/django.cfg echo "SECRET_KEY=${{ secrets.SECRET_KEY }}" >> config/django.cfg @@ -33,8 +41,8 @@ jobs: echo "EMAIL=${{ secrets.EMAIL }}" >> config/django.cfg echo "DOMAIN=${{ secrets.DOMAIN }}" >> config/django.cfg - # Creazione del file di configurazione per Postgres (db.cfg) - - name: Creazione del file di configurazione per Postgres (db.cfg) + + - name: Creation of config file for Postgres (db.cfg) run: | echo "POSTGRES_DB=${{ secrets.POSTGRES_DB }}" >> config/db.cfg echo "POSTGRES_USER=${{ secrets.POSTGRES_USER }}" >> config/db.cfg @@ -42,8 +50,8 @@ jobs: echo "SQL_HOST=${{ secrets.SQL_HOST }}" >> config/db.cfg echo "SQL_PORT=${{ secrets.SQL_PORT }}" >> config/db.cfg - # Creazione del file di configurazione per Gold Postgres (gold.cfg) - - name: Creazione del file di configurazione per Gold Postgres (gold.cfg) + + - name: Creation of config file for Gold Postgres (gold.cfg) run: | echo "GOLD_POSTGRES_DB=${{ secrets.GOLD_POSTGRES_DB }}" >> config/gold.cfg echo "GOLD_POSTGRES_USER=${{ secrets.GOLD_POSTGRES_USER }}" >> config/gold.cfg @@ -51,41 +59,67 @@ jobs: echo "GOLD_SQL_HOST=${{ secrets.GOLD_SQL_HOST }}" >> config/gold.cfg echo "GOLD_SQL_PORT=${{ secrets.GOLD_SQL_PORT }}" >> config/gold.cfg - # Salva i file di configurazione come artifact - - name: Salva file di configurazione come artifact + + - name: Save config files as artifact uses: actions/upload-artifact@v4 with: name: config-files path: ./config/ - # Job 2: Lettura e visualizzazione degli artifacts - read-config: + + build_and_push: runs-on: ubuntu-latest - needs: create-config + needs: create-config steps: - - name: Scarica i file di configurazione + + - name: Checkout the repo + uses: actions/checkout@v4 + with: + submodules: recursive + token: ${{ secrets.GITHUB_TOKEN }} + + + - name: Download configuration files uses: actions/download-artifact@v4 with: name: config-files - path: ./downloaded-config/ - # Verifica il percorso di scaricamento e memorizzalo - - name: Verifica e memorizza il percorso di scaricamento - run: echo "ARTIFACT_PATH=$(pwd)/downloaded-config/" >> $GITHUB_ENV + + - name: Verify and memorize path of download + run: echo "ARTIFACT_PATH=$(pwd)/config/" >> $GITHUB_ENV - # Lista dei file scaricati - - name: Lista dei file scaricati - run: ls -R ${{ env.ARTIFACT_PATH }} + + - name: Display content of configuration files + run: | + cat ${{ env.ARTIFACT_PATH }}django.cfg + cat ${{ env.ARTIFACT_PATH }}db.cfg + cat ${{ env.ARTIFACT_PATH }}gold.cfg - # Mostra il contenuto del file principale di configurazione (.cfg) - - name: Mostra il contenuto del file principale di configurazione (.cfg) - run: cat ${{ env.ARTIFACT_PATH }}django.cfg + + - name: Build Docker image using Docker Compose + run: docker compose -f docker-compose.dev.yml build - # Mostra il contenuto del file di configurazione per Postgres (db.cfg) - - name: Mostra il contenuto del file di configurazione per Postgres (db.cfg) - run: cat ${{ env.ARTIFACT_PATH }}db.cfg + + - name: Verify Docker image creation + run: docker images - # Mostra il contenuto del file di configurazione per Gold Postgres (gold.cfg) - - name: Mostra il contenuto del file di configurazione per Gold Postgres (gold.cfg) - run: cat ${{ env.ARTIFACT_PATH }}gold.cfg + + - name: Set lower case owner and repo names + run: | + echo "OWNER_LC=${{ github.repository_owner,, }}" >>${GITHUB_ENV} + echo "REPO_NAME_LC=${{ github.repository,, }}" >>${GITHUB_ENV} + + + - name: Tag image for GHCR + run: | + docker tag webapp_django ${{ env.REGISTRY }}/${OWNER_LC}/${REPO_NAME_LC}:${{ inputs.tag }} + + + - name: Log in to GitHub Container Registry (GHCR) + run: echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin + + + - name: Push image to GHCR + run: | + docker push ${{ env.REGISTRY }}/${OWNER_LC}/${REPO_NAME_LC}:${{ inputs.tag }} diff --git a/.github/workflows/non-functioning_server_setup _orchestrator.yml b/.github/workflows/non-functioning_server_setup _orchestrator.yml deleted file mode 100644 index 17e7f3a..0000000 --- a/.github/workflows/non-functioning_server_setup _orchestrator.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: legacy Server Setup Orchestrator - -on: - workflow_dispatch: # Esegui manualmente il setup del server - -env: - IMAGE_NAME: djangoforge - -jobs: - setup: - runs-on: ubuntu-latest - - steps: - - # Step 0: Checkout the repository to access workflows - - name: Checkout Repository - uses: actions/checkout@v4 - - # Step 1: Setup the server (Docker, Nginx, etc.) - - name: Setup Server - uses: ./.github/workflows/_setup-server.yml - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - private_key: ${{ secrets.PRIVATE_KEY }} - - - - name: Set ENV variables - run: | - echo "REPO_NAME=${GITHUB_REPOSITORY#$GITHUB_REPOSITORY_OWNER/}" >> $GITHUB_ENV - echo $GITHUB_ENV - - # Step 2: Pass all secrets as inputs to create config files - - name: Create Config Files - uses: ./.github/workflows/_create-cfg-files.yml - with: - repo_name: ${{ env.REPO_NAME }} - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - private_key: ${{ secrets.PRIVATE_KEY }} - debug: ${{ secrets.DEBUG }} - secret_key: ${{ secrets.SECRET_KEY }} - django_allowed_hosts: ${{ secrets.DJANGO_ALLOWED_HOSTS }} - sql_engine: ${{ secrets.SQL_ENGINE }} - database: ${{ secrets.DATABASE }} - postgres_db: ${{ secrets.POSTGRES_DB }} - postgres_user: ${{ secrets.POSTGRES_USER }} - postgres_password: ${{ secrets.POSTGRES_PASSWORD }} - sql_host: ${{ secrets.SQL_HOST }} - sql_port: ${{ secrets.SQL_PORT }} - gold_postgres_db: ${{ secrets.GOLD_POSTGRES_DB }} - gold_postgres_user: ${{ secrets.GOLD_POSTGRES_USER }} - gold_postgres_password: ${{ secrets.GOLD_POSTGRES_PASSWORD }} - gold_sql_host: ${{ secrets.GOLD_SQL_HOST }} - gold_sql_port: ${{ secrets.GOLD_SQL_PORT }} - email: ${{ secrets.EMAIL }} - domain: ${{ secrets.DOMAIN }} - - # Step 3: Setup Nginx and Certbot for SSL (this will now do the checkout inside it) - - name: Setup Nginx and Certbot - uses: ./.github/workflows/_nginx-certbot.yml - with: - domain: ${{ secrets.DOMAIN }} - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - private_key: ${{ secrets.PRIVATE_KEY }} - email: ${{ secrets.EMAIL }} - ghcr_token: ${{ secrets.GHCR_TOKEN }} - - # Step 4: Deploy Docker Compose (checkout inside this step) - - name: Deploy Docker Compose - uses: ./.github/workflows/_deploy.yml - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - private_key: ${{ secrets.PRIVATE_KEY }} - repo_name: ${{ env.REPO_NAME }} - ghcr_token: ${{ secrets.GHCR_TOKEN }} - image_name: ${{ env.IMAGE_NAME }} diff --git a/.github/workflows/non-functioning_server_setup.yml b/.github/workflows/non-functioning_server_setup.yml deleted file mode 100644 index 71a7650..0000000 --- a/.github/workflows/non-functioning_server_setup.yml +++ /dev/null @@ -1,192 +0,0 @@ -name: legacy Setup Server - -on: - workflow_dispatch: # Trigger manual workflow run - inputs: - domains: - description: 'Domain names, separated by commas' - required: true - -env: - REGISTRY: ghcr.io - IMAGE_NAME: djangoforge - - -jobs: - setup-server: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - submodules: recursive - token: ${{ secrets.GHCR_TOKEN }} - - - name: Upgrade server and install Docker & Nginx - uses: appleboy/ssh-action@v0.1.3 - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.PRIVATE_KEY }} - script: | - sudo apt update -y - sudo apt upgrade -y - # Add Docker's official GPG key: - sudo apt-get update - sudo apt-get install ca-certificates curl - sudo install -m 0755 -d /etc/apt/keyrings - sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc - sudo chmod a+r /etc/apt/keyrings/docker.asc - - # Add the repository to Apt sources: - echo \ - "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ - $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ - sudo tee /etc/apt/sources.list.d/docker.list > /dev/null - sudo apt-get update -y - - sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose docker-compose-plugin -y - sudo apt install nginx curl -y - - - - name: Set ENV variables - run: | - echo "REPO_NAME=${GITHUB_REPOSITORY#$GITHUB_REPOSITORY_OWNER/}" >> $GITHUB_ENV - echo $GITHUB_ENV - - - - name: Create project directory and conf file - uses: appleboy/ssh-action@v0.1.3 - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.PRIVATE_KEY }} - script: | - mkdir -p "/opt/${{ env.REPO_NAME }}" - mkdir -p "/opt/${{ env.REPO_NAME }}/config" - rm /opt/${{ env.REPO_NAME }}/config/.cfg - rm /opt/${{ env.REPO_NAME }}/config/db.cfg - rm /opt/${{ env.REPO_NAME }}/config/gold.cfg - - echo "DEBUG=${{ secrets.DEBUG }}" >> "/opt/${{ env.REPO_NAME }}/config/.cfg" - echo "SECRET_KEY=${{ secrets.SECRET_KEY }}" >> "/opt/${{ env.REPO_NAME }}/config/.cfg" - echo "DJANGO_ALLOWED_HOSTS=${{ secrets.DJANGO_ALLOWED_HOSTS }}" >> "/opt/${{ env.REPO_NAME }}/config/.cfg" - echo "SQL_ENGINE=${{ secrets.SQL_ENGINE }}" >> "/opt/${{ env.REPO_NAME }}/config/.cfg" - echo "DATABASE=${{ secrets.DATABASE }}" >> "/opt/${{ env.REPO_NAME }}/config/.cfg" - - echo "POSTGRES_DB=${{ secrets.POSTGRES_DB }}" >> "/opt/${{ env.REPO_NAME }}/config/.cfg" - echo "POSTGRES_USER=${{ secrets.POSTGRES_USER }}" >> "/opt/${{ env.REPO_NAME }}/config/.cfg" - echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> "/opt/${{ env.REPO_NAME }}/config/.cfg" - echo "SQL_HOST=${{ secrets.SQL_HOST }}" >> "/opt/${{ env.REPO_NAME }}/config/.cfg" - echo "SQL_PORT=${{ secrets.SQL_PORT }}" >> "/opt/${{ env.REPO_NAME }}/config/.cfg" - - echo "GOLD_POSTGRES_DB=${{ secrets.GOLD_POSTGRES_DB }}" >> "/opt/${{ env.REPO_NAME }}/config/.cfg" - echo "GOLD_POSTGRES_USER=${{ secrets.GOLD_POSTGRES_USER }}" >> "/opt/${{ env.REPO_NAME }}/config/.cfg" - echo "GOLD_POSTGRES_PASSWORD=${{ secrets.GOLD_POSTGRES_PASSWORD }}" >> "/opt/${{ env.REPO_NAME }}/config/.cfg" - echo "GOLD_SQL_HOST=${{ secrets.GOLD_SQL_HOST }}" >> "/opt/${{ env.REPO_NAME }}/config/.cfg" - echo "GOLD_SQL_PORT=${{ secrets.GOLD_SQL_PORT }}" >> "/opt/${{ env.REPO_NAME }}/config/.cfg" - - - echo "POSTGRES_DB=${{ secrets.POSTGRES_DB }}" >> "/opt/${{ env.REPO_NAME }}/config/db.cfg" - echo "POSTGRES_USER=${{ secrets.POSTGRES_USER }}" >> "/opt/${{ env.REPO_NAME }}/config/db.cfg" - echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> "/opt/${{ env.REPO_NAME }}/config/db.cfg" - echo "SQL_HOST=${{ secrets.SQL_HOST }}" >> "/opt/${{ env.REPO_NAME }}/config/db.cfg" - echo "SQL_PORT=${{ secrets.SQL_PORT }}" >> "/opt/${{ env.REPO_NAME }}/config/db.cfg" - - - echo "GOLD_POSTGRES_DB=${{ secrets.GOLD_POSTGRES_DB }}" >> "/opt/${{ env.REPO_NAME }}/config/gold.cfg" - echo "GOLD_POSTGRES_USER=${{ secrets.GOLD_POSTGRES_USER }}" >> "/opt/${{ env.REPO_NAME }}/config/gold.cfg" - echo "GOLD_POSTGRES_PASSWORD=${{ secrets.GOLD_POSTGRES_PASSWORD }}" >> "/opt/${{ env.REPO_NAME }}/config/gold.cfg" - echo "GOLD_SQL_HOST=${{ secrets.GOLD_SQL_HOST }}" >> "/opt/${{ env.REPO_NAME }}/config/gold.cfg" - echo "GOLD_SQL_PORT=${{ secrets.GOLD_SQL_PORT }}" >> "/opt/${{ env.REPO_NAME }}/config/gold.cfg" - - - echo "EMAIL=${{ secrets.EMAIL }}" >> "/opt/${{ env.REPO_NAME }}/config/.cfg" - echo "DOMAIN=${{ secrets.DOMAIN }}" >> "/opt/${{ env.REPO_NAME }}/config/.cfg" - - - cat "/opt/${{ env.REPO_NAME }}/config/.cfg" - cat "/opt/${{ env.REPO_NAME }}/config/db.cfg" - cat "/opt/${{ env.REPO_NAME }}/config/gold.cfg" - - - - name: SCP Docker Compose file - uses: appleboy/scp-action@master - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.PRIVATE_KEY }} - source: "./docker-compose.prod.yml" - target: "/opt/${{ env.REPO_NAME }}/" - - - name: Start containers - uses: appleboy/ssh-action@v0.1.3 - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.PRIVATE_KEY }} - script: | - echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin - - docker pull ghcr.io/leobitto/${{ env.IMAGE_NAME }}:latest - - docker tag ghcr.io/leobitto/${{ env.IMAGE_NAME }}:latest ${{ env.IMAGE_NAME }} - - mkdir -p /opt/web/static - mkdir -p /opt/web/media - - - docker-compose -f /opt/${{ env.REPO_NAME }}/docker-compose.prod.yml up -d - echo "wait 5 sec for POSTGRES service to fully start" - sleep 5 - echo "5 seconds has passed" - docker exec web python manage.py migrate - docker exec web python manage.py collectstatic --noinput --clear - - - - name: SCP Nginx conf file - uses: appleboy/scp-action@master - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.PRIVATE_KEY }} - source: "nginx/" - target: "/etc/nginx/sites-available/" - strip_components: 1 - - - - name: Update Nginx configuration file - uses: appleboy/ssh-action@v0.1.3 - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.PRIVATE_KEY }} - script: | - sed -i "s/localhost/${{ secrets.DOMAIN }}/g" /etc/nginx/sites-available/nginx.conf - ln -s /etc/nginx/sites-available/nginx.conf /etc/nginx/sites-enabled - nginx -t - systemctl restart nginx - ufw delete allow 8000 - ufw allow 'Nginx Full' - - - - name: Request Certbot certificates - uses: appleboy/ssh-action@v0.1.3 - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.PRIVATE_KEY }} - script: | - apt-get remove certbot - snap install --classic certbot - ln -s /snap/bin/certbot /usr/bin/certbot - - certbot --nginx --non-interactive --agree-tos --email ${{ secrets.EMAIL }} --domains ${{ inputs.domains }} - certbot renew --dry-run - - - - - - diff --git a/.github/workflows/non-functioning_setup_server.yml b/.github/workflows/non-functioning_setup_server.yml deleted file mode 100644 index 09498b0..0000000 --- a/.github/workflows/non-functioning_setup_server.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: legacy Setup Server - -on: - workflow_call: # Definisci che il workflow può essere richiamato - inputs: - host: - description: "Host IP Address" - required: true - username: - description: "Username for SSH" - required: true - private_key: - description: "Private key for SSH access" - required: true - -jobs: - setup-server: - runs-on: ubuntu-latest - - steps: - - name: Upgrade server and install Docker & Nginx - uses: appleboy/ssh-action@v0.1.3 - with: - host: ${{ inputs.host }} - username: ${{ inputs.username }} - key: ${{ inputs.private_key }} - script: | - sudo apt update -y - sudo apt upgrade -y - # Add Docker's official GPG key: - sudo apt-get update - sudo apt-get install ca-certificates curl - sudo install -m 0755 -d /etc/apt/keyrings - sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc - sudo chmod a+r /etc/apt/keyrings/docker.asc - - # Add the repository to Apt sources: - echo \ - "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ - $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ - sudo tee /etc/apt/sources.list.d/docker.list > /dev/null - sudo apt-get update -y - - sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose docker-compose-plugin -y - sudo apt install nginx curl -y diff --git a/.github/workflows/non_f-create_cfg_files.yml b/.github/workflows/non_f-create_cfg_files.yml deleted file mode 100644 index 9686085..0000000 --- a/.github/workflows/non_f-create_cfg_files.yml +++ /dev/null @@ -1,128 +0,0 @@ -name: old - Create Configuration Files - -on: - workflow_call: - inputs: - repo_name: - description: "Repository Name" - required: true - host: - description: "Host IP Address" - required: true - username: - description: "Username for SSH" - required: true - private_key: - description: "Private Key for SSH" - required: true - debug: - description: "Debug mode" - required: true - default: "False" # Aggiunto un valore di default - secret_key: - description: "Django Secret Key" - required: true - django_allowed_hosts: - description: "Allowed hosts for Django" - required: true - sql_engine: - description: "SQL Engine for Django" - required: true - database: - description: "Database name" - required: true - postgres_db: - description: "Postgres DB name" - required: true - postgres_user: - description: "Postgres DB user" - required: true - postgres_password: - description: "Postgres DB password" - required: true - sql_host: - description: "SQL Host" - required: true - sql_port: - description: "SQL Port" - required: true - gold_postgres_db: - description: "Gold Postgres DB name" - required: true - gold_postgres_user: - description: "Gold Postgres DB user" - required: true - gold_postgres_password: - description: "Gold Postgres DB password" - required: true - gold_sql_host: - description: "Gold SQL Host" - required: true - gold_sql_port: - description: "Gold SQL Port" - required: true - email: - description: "Email" - required: true - domain: - description: "Domain for Django and Nginx" - required: true - -jobs: - create-config: - runs-on: ubuntu-latest - - steps: - - name: Create configuration files on the server - uses: appleboy/ssh-action@v0.1.3 - with: - host: ${{ inputs.host }} - username: ${{ inputs.username }} - key: ${{ inputs.private_key }} - script: | - # Creazione delle cartelle di configurazione - mkdir -p "/opt/${{ inputs.repo_name }}/config" - - # Rimozione di vecchi file di configurazione (se esistono) - rm -f /opt/${{ inputs.repo_name }}/config/.cfg - rm -f /opt/${{ inputs.repo_name }}/config/db.cfg - rm -f /opt/${{ inputs.repo_name }}/config/gold.cfg - - # Creazione del file principale di configurazione (.cfg) - echo "DEBUG=${{ inputs.debug }}" >> "/opt/${{ inputs.repo_name }}/config/.cfg" - echo "SECRET_KEY=${{ inputs.secret_key }}" >> "/opt/${{ inputs.repo_name }}/config/.cfg" - echo "DJANGO_ALLOWED_HOSTS=${{ inputs.django_allowed_hosts }}" >> "/opt/${{ inputs.repo_name }}/config/.cfg" - echo "SQL_ENGINE=${{ inputs.sql_engine }}" >> "/opt/${{ inputs.repo_name }}/config/.cfg" - echo "DATABASE=${{ inputs.database }}" >> "/opt/${{ inputs.repo_name }}/config/.cfg" - echo "POSTGRES_DB=${{ inputs.postgres_db }}" >> "/opt/${{ inputs.repo_name }}/config/.cfg" - echo "POSTGRES_USER=${{ inputs.postgres_user }}" >> "/opt/${{ inputs.repo_name }}/config/.cfg" - echo "POSTGRES_PASSWORD=${{ inputs.postgres_password }}" >> "/opt/${{ inputs.repo_name }}/config/.cfg" - echo "SQL_HOST=${{ inputs.sql_host }}" >> "/opt/${{ inputs.repo_name }}/config/.cfg" - echo "SQL_PORT=${{ inputs.sql_port }}" >> "/opt/${{ inputs.repo_name }}/config/.cfg" - echo "GOLD_POSTGRES_DB=${{ inputs.gold_postgres_db }}" >> "/opt/${{ inputs.repo_name }}/config/.cfg" - echo "GOLD_POSTGRES_USER=${{ inputs.gold_postgres_user }}" >> "/opt/${{ inputs.repo_name }}/config/.cfg" - echo "GOLD_POSTGRES_PASSWORD=${{ inputs.gold_postgres_password }}" >> "/opt/${{ inputs.repo_name }}/config/.cfg" - echo "GOLD_SQL_HOST=${{ inputs.gold_sql_host }}" >> "/opt/${{ inputs.repo_name }}/config/.cfg" - echo "GOLD_SQL_PORT=${{ inputs.gold_sql_port }}" >> "/opt/${{ inputs.repo_name }}/config/.cfg" - echo "EMAIL=${{ inputs.email }}" >> "/opt/${{ inputs.repo_name }}/config/.cfg" - echo "DOMAIN=${{ inputs.domain }}" >> "/opt/${{ inputs.repo_name }}/config/.cfg" - - # Creazione del file di configurazione per Postgres (db.cfg) - echo "POSTGRES_DB=${{ inputs.postgres_db }}" >> "/opt/${{ inputs.repo_name }}/config/db.cfg" - echo "POSTGRES_USER=${{ inputs.postgres_user }}" >> "/opt/${{ inputs.repo_name }}/config/db.cfg" - echo "POSTGRES_PASSWORD=${{ inputs.postgres_password }}" >> "/opt/${{ inputs.repo_name }}/config/db.cfg" - echo "SQL_HOST=${{ inputs.sql_host }}" >> "/opt/${{ inputs.repo_name }}/config/db.cfg" - echo "SQL_PORT=${{ inputs.sql_port }}" >> "/opt/${{ inputs.repo_name }}/config/db.cfg" - - # Creazione del file di configurazione per Gold Postgres (gold.cfg) - echo "GOLD_POSTGRES_DB=${{ inputs.gold_postgres_db }}" >> "/opt/${{ inputs.repo_name }}/config/gold.cfg" - echo "GOLD_POSTGRES_USER=${{ inputs.gold_postgres_user }}" >> "/opt/${{ inputs.repo_name }}/config/gold.cfg" - echo "GOLD_POSTGRES_PASSWORD=${{ inputs.gold_postgres_password }}" >> "/opt/${{ inputs.repo_name }}/config/gold.cfg" - echo "GOLD_SQL_HOST=${{ inputs.gold_sql_host }}" >> "/opt/${{ inputs.repo_name }}/config/gold.cfg" - echo "GOLD_SQL_PORT=${{ inputs.gold_sql_port }}" >> "/opt/${{ inputs.repo_name }}/config/gold.cfg" - - # Stampa di controllo dei file creati - echo "Config files created:" - cat "/opt/${{ inputs.repo_name }}/config/.cfg" - cat "/opt/${{ inputs.repo_name }}/config/db.cfg" - cat "/opt/${{ inputs.repo_name }}/config/gold.cfg"