File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed
Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 8282 needs : validate
8383 steps :
8484 - uses : actions/checkout@v4
85+ - name : Set environment variables
86+ run : |
87+ if [[ "${{ github.ref_name }}" == "alpha" ]]; then
88+ echo "APP_ENV=dev" >> $GITHUB_ENV
89+ echo "DATABASE_URL=mysql://root:symfony@db-branch:3306/symfony" >> $GITHUB_ENV
90+ else
91+ echo "APP_ENV=prod" >> $GITHUB_ENV
92+ echo "DATABASE_URL=mysql://root:symfony@db-branch:3306/symfony" >> $GITHUB_ENV
93+ fi
8594 - name : Login to registry
8695 uses : docker/login-action@v3
8796 with :
94103 context : .
95104 push : true
96105 tags : ${{ secrets.DOCKER_REGISTRY }}/api-php:${{ github.ref_name }}
106+ build-args : |
107+ APP_ENV=${{ env.APP_ENV }}
108+ DATABASE_URL=${{ env.DATABASE_URL }}
97109 - name : Configure SSH
98110 run : |
99111 mkdir -p ~/.ssh/
Original file line number Diff line number Diff line change @@ -3,11 +3,12 @@ FROM registry.realtoken.community/docker-symfony-php:8.4
33WORKDIR /var/www/html
44COPY . ./
55
6- # Composer install sans .env
7- RUN composer install --prefer-dist --no-interaction --optimize-autoloader --no-progress
8-
9- # ARG APP_ENV=prod
6+ ARG APP_ENV=prod
7+ ARG DATABASE_URL
108ENV APP_ENV=${APP_ENV}
9+ ENV DATABASE_URL=${DATABASE_URL}
10+
11+ RUN composer install --prefer-dist --no-interaction --optimize-autoloader --no-progress
1112RUN composer dump-env ${APP_ENV}
1213RUN composer run-script --no-dev post-install-cmd
1314
Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ services:
66 context : ./
77 args :
88 APP_ENV : ${APP_ENV}
9+ DATABASE_URL : ${DATABASE_URL}
10+ environment :
11+ APP_ENV : ${APP_ENV}
12+ DATABASE_URL : ${DATABASE_URL}
913 networks :
1014 - api-${DOCKER_BRANCH}
1115 - traefik-realt
You can’t perform that action at this time.
0 commit comments