diff --git a/.github/workflows/sass-compile.yml b/.github/workflows/build-all.yml similarity index 63% rename from .github/workflows/sass-compile.yml rename to .github/workflows/build-all.yml index eeb4ca3..d16c73f 100644 --- a/.github/workflows/sass-compile.yml +++ b/.github/workflows/build-all.yml @@ -1,4 +1,4 @@ -name: Compile SASS +name: Build Everything on: push: @@ -21,6 +21,12 @@ jobs: submodules: true fetch-depth: 0 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.4' + extensions: none + - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -57,3 +63,31 @@ jobs: if-no-files-found: error retention-days: 90 compression-level: 9 + + - name: Pre-render PHP File + run: | + cd htdocs + php ./index.php > ./index.html + + - name: Upload `index.html` build artifact + uses: actions/upload-artifact@v4 + if: ${{ github.actor == 'aziascreations' }} + with: + name: index.html + path: "./htdocs/index.html" + if-no-files-found: error + retention-days: 90 + compression-level: 9 + + - name: Remove trash + run: | + cd htdocs + rm -rf parts/ + rm *.php + + - name: Deploy demo page to gh-pages + uses: peaceiris/actions-gh-pages@v4 + #if: ${{ github.ref == 'refs/heads/master' }} + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./htdocs \ No newline at end of file diff --git a/.github/workflows/php-render.yml b/.github/workflows/php-render.yml deleted file mode 100644 index 65ff9c7..0000000 --- a/.github/workflows/php-render.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Render PHP Demo Page - -on: - workflow_run: - workflows: ["Compile SASS"] - types: - - completed - -jobs: - php_render: - if: ${{ github.event.workflow_run.conclusion == 'success' }} - runs-on: ubuntu-latest - - steps: - - name: Download artifact - uses: actions/download-artifact@v3 - if: ${{ github.actor == 'aziascreations' }} - with: - path: ./htdocs/css - - - name: Display structure of downloaded files - run: | - cd ./htdocs/css - ls -R - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.4' - extensions: none - - - name: Pre-render PHP File - run: | - cd htdocs - php ./index.php > ./index.html - - - name: Upload `index.html` build artifact - uses: actions/upload-artifact@v4 - if: ${{ github.actor == 'aziascreations' }} - with: - name: index.html - path: "./htdocs/index.html" - if-no-files-found: error - retention-days: 90 - compression-level: 9