Skip to content

Commit

Permalink
Merge pull request #15523 from opf/fix/docker-image-asset-precompile
Browse files Browse the repository at this point in the history
Only allow precompiled assets to be injected when running from CI
  • Loading branch information
machisuji committed May 13, 2024
2 parents 97132f7 + 402b425 commit 612d170
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,5 @@ frontend/node_modules
node_modules
# travis
vendor/bundle
# allow precompiled assets to be injected
!/public/assets
!/config/frontend_assets.manifest.json
/public/assets
/config/frontend_assets.manifest.json
5 changes: 5 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ jobs:
- name: Precompile assets
run: |
./docker/prod/setup/precompile-assets.sh
# public/assets will be saved as artifact, so temporarily copying config file there as well
cp config/frontend_assets.manifest.json public/assets/frontend_assets.manifest.json
- uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -142,6 +143,10 @@ jobs:
ls -al public/
mv public/assets/frontend_assets.manifest.json config/frontend_assets.manifest.json
ls -al config/frontend_assets.manifest.json
# allow precompiled assets to be injected into docker image
echo '' >> .dockerignore
echo '!/public/assets' >> .dockerignore
echo '!/config/frontend_assets.manifest.json' >> .dockerignore
- name: Add build information
run: |
echo "${{ needs.setup.outputs.checkout_ref }}" > PRODUCT_VERSION
Expand Down

0 comments on commit 612d170

Please sign in to comment.