Merge pull request #382 from ferronweb/renovate/develop-2.x-biomejs-b… #201
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 website ("develop" branch; Ferron 2.x) | |
| on: | |
| push: | |
| branches: ["develop-2.x"] | |
| paths: | |
| - "blog/**" | |
| - "docs/**" | |
| - "website/**" | |
| - ".github/workflows/deploy-website-develop-v2.yml" | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| environment: ferron-website-develop-v2 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: develop-2.x | |
| - name: Set up Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies | |
| shell: bash | |
| run: | | |
| pushd website | |
| bun ci || bun install | |
| popd | |
| - name: Build the website | |
| shell: bash | |
| run: | | |
| pushd website | |
| bun run --bun build | |
| echo "User-agent: *" > dist/robots.txt | |
| echo "Disallow: /" >> dist/robots.txt | |
| popd | |
| - name: Precompress the website | |
| shell: bash | |
| run: | | |
| docker run --rm -u "$(id -u):$(id -g)" -v ./website/dist:/tmp/website ferronserver/ferron:2 ferron-precompress /tmp/website | |
| - name: Create the website ZIP archive | |
| uses: thedoctor0/[email protected] | |
| with: | |
| type: "zip" | |
| filename: "../../ferron2-website-develop.zip" | |
| directory: "website/dist" | |
| - name: Set up SSH | |
| uses: LuisEnMarroquin/[email protected] | |
| with: | |
| ORIGIN: ${{ secrets.SSH_HOSTNAME }} | |
| SSHKEY: ${{ secrets.SSH_KEY }} | |
| NAME: ferron-servers | |
| PORT: ${{ secrets.SSH_PORT }} | |
| USER: ${{ secrets.SSH_USERNAME }} | |
| - name: Deploy the website | |
| shell: bash | |
| run: | | |
| scp ferron2-website-develop.zip ferron-servers:. | |
| # The "deploy-ferron2-website-develop" is a custom command that deploys the Ferron website | |
| ssh ferron-servers "sudo deploy-ferron2-website-develop ferron2-website-develop.zip && rm ferron2-website-develop.zip" |