Skip to content

Commit

Permalink
second version of build and push test
Browse files Browse the repository at this point in the history
  • Loading branch information
leoBitto committed Oct 12, 2024
1 parent 93b942d commit 10a4cdd
Showing 1 changed file with 28 additions and 12 deletions.
40 changes: 28 additions & 12 deletions .github/workflows/build_and_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,28 @@ jobs:
- name: Creazione della directory di configurazione
run: mkdir -p config

- name: Creazione del file di configurazione per Django
# Creazione del file principale di configurazione (.cfg)
- name: Creazione del file principale di configurazione (.cfg)
run: |
echo "DEBUG=${{ secrets.DEBUG }}" >> config/django.cfg
echo "SECRET_KEY=${{ secrets.SECRET_KEY }}" >> config/django.cfg
echo "DJANGO_ALLOWED_HOSTS=${{ secrets.DJANGO_ALLOWED_HOSTS }}" >> config/django.cfg
echo "SQL_ENGINE=${{ secrets.SQL_ENGINE }}" >> config/django.cfg
echo "DATABASE=${{ secrets.DATABASE }}" >> config/django.cfg
echo "DOMAIN=${{ secrets.DOMAIN }}" >> config/django.cfg
echo "DEBUG=${{ secrets.DEBUG }}" >> config/.cfg
echo "SECRET_KEY=${{ secrets.SECRET_KEY }}" >> config/.cfg
echo "DJANGO_ALLOWED_HOSTS=${{ secrets.DJANGO_ALLOWED_HOSTS }}" >> config/.cfg
echo "SQL_ENGINE=${{ secrets.SQL_ENGINE }}" >> config/.cfg
echo "DATABASE=${{ secrets.DATABASE }}" >> config/.cfg
echo "POSTGRES_DB=${{ secrets.POSTGRES_DB }}" >> config/.cfg
echo "POSTGRES_USER=${{ secrets.POSTGRES_USER }}" >> config/.cfg
echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> config/.cfg
echo "SQL_HOST=${{ secrets.SQL_HOST }}" >> config/.cfg
echo "SQL_PORT=${{ secrets.SQL_PORT }}" >> config/.cfg
echo "GOLD_POSTGRES_DB=${{ secrets.GOLD_POSTGRES_DB }}" >> config/.cfg
echo "GOLD_POSTGRES_USER=${{ secrets.GOLD_POSTGRES_USER }}" >> config/.cfg
echo "GOLD_POSTGRES_PASSWORD=${{ secrets.GOLD_POSTGRES_PASSWORD }}" >> config/.cfg
echo "GOLD_SQL_HOST=${{ secrets.GOLD_SQL_HOST }}" >> config/.cfg
echo "GOLD_SQL_PORT=${{ secrets.GOLD_SQL_PORT }}" >> config/.cfg
echo "EMAIL=${{ secrets.EMAIL }}" >> config/.cfg
echo "DOMAIN=${{ secrets.DOMAIN }}" >> config/.cfg
# Creazione del file di configurazione per Postgres (db.cfg)
- name: Creazione del file di configurazione per Postgres (db.cfg)
run: |
echo "POSTGRES_DB=${{ secrets.POSTGRES_DB }}" >> config/db.cfg
Expand All @@ -29,6 +42,7 @@ 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)
run: |
echo "GOLD_POSTGRES_DB=${{ secrets.GOLD_POSTGRES_DB }}" >> config/gold.cfg
Expand All @@ -37,25 +51,27 @@ 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
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: config-files
path: ./config/

# Job 2: Lettura e visualizzazione degli artifacts
read-config:
runs-on: ubuntu-latest
needs: create-config # Dipende dal Job 1
needs: create-config

steps:
- name: Scarica i file di configurazione
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: config-files
path: ./config/

- name: Mostra il contenuto del file Django (django.cfg)
run: cat ./config/django.cfg
- name: Mostra il contenuto del file principale di configurazione (.cfg)
run: cat ./config/.cfg

- name: Mostra il contenuto del file di configurazione per Postgres (db.cfg)
run: cat ./config/db.cfg
Expand Down

0 comments on commit 10a4cdd

Please sign in to comment.