25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

45 lines
1.4 KiB

  1. name: 'Frappe Assets'
  2. on:
  3. push:
  4. branches: [ develop ]
  5. jobs:
  6. build-dev-and-publish:
  7. name: 'Build and Publish Assets for Development'
  8. runs-on: ubuntu-latest
  9. steps:
  10. - uses: actions/checkout@v3
  11. with:
  12. path: 'frappe'
  13. - uses: actions/setup-node@v3
  14. with:
  15. node-version: 14
  16. - uses: actions/setup-python@v4
  17. with:
  18. python-version: '3.10'
  19. - name: Set up bench and build assets
  20. run: |
  21. npm install -g yarn
  22. pip3 install -U frappe-bench
  23. bench -v init frappe-bench --no-procfile --no-backups --skip-assets --skip-redis-config-generation --python $(which python) --frappe-path $GITHUB_WORKSPACE/frappe
  24. cd frappe-bench && bench build
  25. - name: Package assets
  26. run: |
  27. mkdir -p $GITHUB_WORKSPACE/build
  28. tar -cvpzf $GITHUB_WORKSPACE/build/$GITHUB_SHA.tar.gz ./frappe-bench/sites/assets/frappe/dist
  29. - name: Publish assets to S3
  30. uses: jakejarvis/s3-sync-action@master
  31. with:
  32. args: --acl public-read
  33. env:
  34. AWS_S3_BUCKET: 'assets.frappeframework.com'
  35. AWS_ACCESS_KEY_ID: ${{ secrets.S3_ASSETS_ACCESS_KEY_ID }}
  36. AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_ASSETS_SECRET_ACCESS_KEY }}
  37. AWS_S3_ENDPOINT: 'http://s3.fr-par.scw.cloud'
  38. AWS_REGION: 'fr-par'
  39. SOURCE_DIR: '$GITHUB_WORKSPACE/build'