Skip to content

Commit

Permalink
Merge pull request #1480 from RoboSats/fix-file-cache-problem-and-sta…
Browse files Browse the repository at this point in the history
…tic-files-management

Fix file cache problem and static files management
  • Loading branch information
KoalaSat authored Sep 18, 2024
2 parents f2a0d0e + 4964992 commit 54d98f9
Show file tree
Hide file tree
Showing 40 changed files with 1,725 additions and 716 deletions.
24 changes: 4 additions & 20 deletions .github/workflows/coordinator-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,15 @@ jobs:
with:
workflow: frontend-build.yml
workflow_conclusion: success
name: web-main-js
path: frontend/static/frontend/
name: django-main-static
path: frontend

- name: 'Download Basic main.js Artifact for a release'
if: inputs.semver != '' # Only if fired as job in release.yml
uses: actions/download-artifact@v4
with:
name: web-main-js
path: frontend/static/frontend/

- name: 'Download pro.js Artifact'
if: inputs.semver == '' # Only if workflow fired from frontend-build.yml
uses: dawidd6/action-download-artifact@v6
with:
workflow: frontend-build.yml
workflow_conclusion: success
name: web-pro-js
path: frontend/static/frontend/

- name: 'Download pro.js Artifact for a release'
if: inputs.semver != '' # Only if fired as job in release.yml
uses: actions/download-artifact@v4
with:
name: web-pro-js
path: frontend/static/frontend/
name: django-main-static
path: frontend

- name: 'Log in to Docker Hub'
uses: docker/login-action@v3
Expand Down
20 changes: 15 additions & 5 deletions .github/workflows/desktop-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,21 @@ jobs:
with:
node-version: '16'

- name: Set up frontend dependencies
run: |
cd frontend
npm install
npm run build
- name: 'Download Basic main.js Artifact'
if: inputs.semver == '' # Only if workflow fired from frontend-build.yml
uses: dawidd6/action-download-artifact@v6
with:
workflow: frontend-build.yml
workflow_conclusion: success
name: desktop-main-static
path: desktopApp

- name: 'Download Basic main.js Artifact for a release'
if: inputs.semver != '' # Only if fired as job in release.yml
uses: actions/download-artifact@v4
with:
name: desktop-main-static
path: desktopApp

- name: Install dependencies
run: |
Expand Down
30 changes: 22 additions & 8 deletions .github/workflows/frontend-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,34 @@ jobs:
export NODE_OPTIONS="--max-old-space-size=4096"
cd frontend
npm run build
- name: 'Archive Web Basic Build Results'
- name: 'Archive Django Static Build Results'
uses: actions/upload-artifact@v4
with:
name: web-main-js
name: django-main-static
path: |
frontend/static/frontend/*main.js
frontend/static/frontend/*.wasm
- name: 'Archive Web PRO Build Results'
frontend/static
frontend/templates/frontend/*.html
- name: 'Archive Node App Static Build Results'
uses: actions/upload-artifact@v4
with:
name: web-pro-js
name: nodeapp-main-static
path: |
frontend/static/frontend/*pro.js
frontend/static/frontend/*.wasm
nodeapp/static
nodeapp/*.html
- name: 'Archive Desktop App Static Build Results'
uses: actions/upload-artifact@v4
with:
name: desktop-main-static
path: |
desktopApp/static
desktopApp/*.html
- name: 'Archive Django Static Build Results'
uses: actions/upload-artifact@v4
with:
name: web-main-static
path: |
web/static
web/*.html
- name: 'Archive Mobile Build Results'
uses: actions/upload-artifact@v4
with:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ jobs:
- name: 'Checkout'
uses: actions/checkout@v4

- name: 'Download static files Artifact'
uses: dawidd6/action-download-artifact@v6
with:
workflow: frontend-build.yml
workflow_conclusion: success
name: django-main-static
path: frontend

- name: Patch Dockerfile and .env-sample
run: |
sed -i "1s/FROM python:.*/FROM python:${{ matrix.python-tag }}/" Dockerfile
Expand Down
31 changes: 6 additions & 25 deletions .github/workflows/selfhosted-client-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,40 +21,21 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: 'Copy Static' # Needed since Github actions does not support symlinks
run: cp -r frontend/static nodeapp/static

- name: 'Download basic.selfhosted.js Artifact'
if: inputs.semver == '' # Only if workflow fired from frontend-build.yml
uses: dawidd6/action-download-artifact@v6
with:
workflow: frontend-build.yml
workflow_conclusion: success
name: web-main-js
path: nodeapp/static/frontend/

- name: 'Download main.js Artifact for a release'
if: inputs.semver != '' # Only if fired as job in release.yml
uses: actions/download-artifact@v4
with:
name: web-main-js
path: nodeapp/static/frontend/

- name: 'Download pro.selfhosted.js Artifact'
- name: 'Download Basic main.js Artifact'
if: inputs.semver == '' # Only if workflow fired from frontend-build.yml
uses: dawidd6/action-download-artifact@v6
with:
workflow: frontend-build.yml
workflow_conclusion: success
name: web-pro-js
path: nodeapp/static/frontend/
name: nodeapp-main-static
path: nodeapp

- name: 'Download pro.js Artifact for a release'
- name: 'Download Basic main.js Artifact for a release'
if: inputs.semver != '' # Only if fired as job in release.yml
uses: actions/download-artifact@v4
with:
name: web-pro-js
path: nodeapp/static/frontend/
name: nodeapp-main-static
path: nodeapp

- name: 'Log in to Docker Hub'
uses: docker/login-action@v3
Expand Down
31 changes: 6 additions & 25 deletions .github/workflows/web-client-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,40 +21,21 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: 'Copy Static' # Needed since Github actions does not support symlinks
run: cp -r frontend/static web/static

- name: 'Download main.js Artifact'
if: inputs.semver == '' # Only if workflow fired from frontend-build.yml
uses: dawidd6/action-download-artifact@v6
with:
workflow: frontend-build.yml
workflow_conclusion: success
name: web-main-js
path: web/static/frontend/

- name: 'Download main.js Artifact for a release'
if: inputs.semver != '' # Only if fired as job in release.yml
uses: actions/download-artifact@v4
with:
name: web-main-js
path: web/static/frontend/

- name: 'Download pro.js Artifact'
- name: 'Download Basic main.js Artifact'
if: inputs.semver == '' # Only if workflow fired from frontend-build.yml
uses: dawidd6/action-download-artifact@v6
with:
workflow: frontend-build.yml
workflow_conclusion: success
name: web-pro-js
path: web/static/frontend/
name: web-main-static
path: web

- name: 'Download pro.js Artifact for a release'
- name: 'Download Basic main.js Artifact for a release'
if: inputs.semver != '' # Only if fired as job in release.yml
uses: actions/download-artifact@v4
with:
name: web-pro-js
path: web/static/frontend/
name: web-main-static
path: web

- name: 'Log in to Docker Hub'
uses: docker/login-action@v3
Expand Down
19 changes: 13 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -634,22 +634,29 @@ frontend/static/assets/avatars*
api/lightning/*_grpc.py
api/lightning/*_pb2.py
api/lightning/pymp*
api/lightning/pip*
frontend/static/locales/collected_phrases.json
frontend/static/admin*
frontend/static/rest_framework*
frontend/static/import_export*
frontend/static/drf_spectacular_sidecar/
frontend/src/components/PaymentMethods/Icons/code*
frontend/src/components/PaymentMethods/Icons/webp*
frontend/static/frontend/**
frontend/static/frontend
docs/.jekyll-cache*
docs/_site*
node

# mobile frontend statics
mobile/html/Web.bundle/js*
mobile/html/Web.bundle/css*
mobile/html/Web.bundle/assets*
desktopApp/release-builds

# frontend statics
frontend/templates/frontend/*.html
mobile/html/Web.bundle
desktopApp/static
desktopApp/*.html
web/static
web/*.html
nodeapp/static
nodeapp/*.html

# Protocol Buffers
api/lightning/*.proto
63 changes: 0 additions & 63 deletions desktopApp/index.html

This file was deleted.

1 change: 0 additions & 1 deletion desktopApp/static

This file was deleted.

Loading

0 comments on commit 54d98f9

Please sign in to comment.