Source reformatting: switch to no line-breaking #8372
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: Build | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| path: 'source' | |
| - name: Check Formatting | |
| run: | | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
| source $HOME/.cargo/env | |
| cargo install reformahtml | |
| mkdir tmp | |
| reformahtml source/source tmp/reformatted-source | |
| diff source/source tmp/reformatted-source > tmp/diff_output.txt || true | |
| if [ -s tmp/diff_output.txt ]; then | |
| cat tmp/diff_output.txt | |
| exit 1 | |
| fi | |
| - name: Build | |
| run: | | |
| mkdir output | |
| docker run --mount "type=bind,source=$GITHUB_WORKSPACE/source,destination=/whatwg/html,readonly=1" \ | |
| --env "HTML_SOURCE=/whatwg/html" \ | |
| --mount "type=bind,source=$GITHUB_WORKSPACE/output,destination=/whatwg/output" \ | |
| --env "HTML_OUTPUT=/whatwg/output" \ | |
| ghcr.io/whatwg/html-build | |
| - name: Deploy | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| env: | |
| SERVER: ${{ secrets.MARQUEE_SERVER }} | |
| SERVER_PUBLIC_KEY: ${{ secrets.MARQUEE_PUBLIC_KEY }} | |
| SERVER_DEPLOY_KEY: ${{ secrets.MARQUEE_DEPLOY_KEY }} | |
| run: | | |
| eval "$(ssh-agent -s)" | |
| echo "$SERVER_DEPLOY_KEY" | ssh-add - | |
| mkdir -p ~/.ssh/ && echo "$SERVER $SERVER_PUBLIC_KEY" > ~/.ssh/known_hosts | |
| # Sync, including deletes, but ignoring the stuff we'll deploy below, so that we don't delete them. | |
| # --chmod=D755,F644 means read-write for user, read-only for others. | |
| echo "Deploying build output..." | |
| rsync --archive --chmod=D755,F644 --compress --verbose \ | |
| --delete --exclude="commit-snapshots" --exclude="review-drafts" \ | |
| "$GITHUB_WORKSPACE/output/" "deploy@$SERVER:/var/www/html.spec.whatwg.org" | |
| echo "" | |
| echo "Deploying Commit Snapshot and Review Drafts, if any..." | |
| rsync --archive --chmod=D755,F644 --compress --verbose \ | |
| "$GITHUB_WORKSPACE/output/commit-snapshots" "$GITHUB_WORKSPACE/output/review-drafts" "deploy@$SERVER:/var/www/html.spec.whatwg.org" |