This commit is contained in:
Ronald A. Richardson
2023-08-02 18:21:34 +08:00
parent 00b49a7c04
commit 475c03c077
2 changed files with 10 additions and 8 deletions

View File

@@ -10,7 +10,6 @@ concurrency:
env:
PROJECT: ${{ secrets.PROJECT }}
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets._GITHUB_AUTH_TOKEN }}"}}'
jobs:
build_service:
@@ -49,7 +48,9 @@ jobs:
- name: Prepare Composer Auth Secret
run: |
if [[ -n "${{ secrets._GITHUB_AUTH_TOKEN }}" ]]; then
echo '${{ env.COMPOSER_AUTH }}' > composer-auth.json
echo '{"github-oauth": {"github.com": "'${{ secrets._GITHUB_AUTH_TOKEN }}'"}}' > composer-auth.json
else
echo '{}' > composer-auth.json
fi
- name: Build and Release

View File

@@ -36,6 +36,7 @@ COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Set some build ENV variables
ENV LOG_CHANNEL=stdout
ENV CACHE_DRIVER=null
# For development only
WORKDIR /var/www/html
@@ -46,6 +47,12 @@ WORKDIR /var/www/html/api
COPY --chown=www-data:nogroup ./api ./
RUN chown -R www-data:www-data /var/www/html/api
# Setup composer root directory
RUN mkdir -p /root/.composer
# Load the secret into the auth.json file.
RUN --mount=type=secret,id=composer_auth,dst=/root/.composer/auth.json
# Setup logging
# RUN mkdir -p ./storage/logs/ && ln -sf /dev/stdout ./storage/logs/laravel-$(date +'%Y-%m-%d').log
RUN mkdir -p ./storage/logs/ && touch ./storage/logs/laravel-$(date +'%Y-%m-%d').log
@@ -64,12 +71,6 @@ WORKDIR /
# Create unique instance ID
RUN echo $(cat /proc/sys/kernel/random/uuid) > /.fleetbase
# Setup composer root directory
RUN mkdir -p /root/.composer
# Load the secret into the auth.json file.
RUN --mount=type=secret,id=composer_auth,dst=/root/.composer/auth.json
# Set environment
ARG ENVIRONMENT=production
ENV APP_ENV=$ENVIRONMENT