Deploy #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy | |
| on: | |
| workflow_run: | |
| workflows: [CI] | |
| types: | |
| - completed | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| build-and-deploy: | |
| if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && github.event.workflow_run.head_branch == 'main' }} | |
| runs-on: ubuntu-24.04 | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deploy.outputs.page_url }} | |
| env: | |
| MIX_ENV: prod | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| ref: ${{ github.event.workflow_run.head_sha }} | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@3580539ceec3dc05b0ed51e9e10b08eb7a7c2bb4 | |
| with: | |
| elixir-version: "1.18.4" | |
| otp-version: "27.3" | |
| - name: Restore Mix dependencies cache | |
| uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: deploy-soonex-${{ runner.os }}-27.3-1.18.4-${{ hashFiles('mix.lock') }} | |
| restore-keys: | | |
| deploy-soonex-${{ runner.os }}-27.3-1.18.4- | |
| - name: Install Mix dependencies | |
| run: mix deps.get | |
| - name: Set up Node.js | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 | |
| with: | |
| node-version: "24" | |
| cache: npm | |
| cache-dependency-path: assets/package-lock.json | |
| - name: Install npm dependencies | |
| working-directory: assets | |
| run: npm ci | |
| - name: Build static site | |
| run: mix build | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa | |
| with: | |
| path: _site | |
| - name: Deploy to GitHub Pages | |
| id: deploy | |
| uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 |