Remove check in commit and push #7
Workflow file for this run
This file contains 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
# Copyright © SixtyFPS GmbH <[email protected]> | |
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 | |
name: Build New Docs | |
on: | |
push: | |
branches: ["docs-tng"] | |
pull_request: | |
branches: [master, "feature/*"] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
docs: | |
runs-on: ubuntu-24.04 | |
env: | |
# Allow deprecated warning because we are using nightly and some things might be deprecated in nightly | |
# for which the stable alternative is not yet available. | |
RUSTFLAGS: -D warnings -W deprecated | |
RUSTDOCFLAGS: --html-in-header=/home/runner/work/slint/slint/docs/resources/slint-docs-highlight.html -D warnings -W deprecated | |
SLINT_NO_QT: 1 | |
CARGO_INCREMENTAL: false | |
RELEASE_INPUT: ${{ inputs.release }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- uses: pnpm/[email protected] | |
with: | |
version: 9.11.0 | |
# - name: Check license headers | |
# run: cargo xtask check_license_headers --fix-it | |
# - name: Suggest license header changes | |
# uses: reviewdog/action-suggester@v1 | |
# with: | |
# tool_name: xtask license_header | |
# level: error | |
# fail_on_error: true | |
# - run: sudo apt-get install reuse | |
# - name: Check reuse compliance | |
# run: cargo xtask check_reuse_compliance | |
# Build Docs | |
- name: Install starlight dependencies | |
run: cd docs && pnpm i --frozen-lockfile --ignore-scripts | |
- name: Build docs | |
run: cd docs && pnpm build | |
# Commit to www-releases/snapshots/tng | |
- name: Generate a token | |
id: app-token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ vars.READ_WRITE_APP_ID }} | |
private-key: ${{ secrets.READ_WRITE_PRIVATE_KEY }} | |
repositories: www-releases | |
- name: Clone www-releases/snapshots directory | |
uses: actions/checkout@v4 | |
with: | |
repository: slint-ui/www-releases | |
path: www-releases | |
token: ${{ steps.app-token.outputs.token }} | |
sparse-checkout: | | |
snapshots/tng | |
- name: copy docs to www-releases | |
run: | | |
rm -rf www-releases/snapshots/tng | |
mkdir -p www-releases/snapshots/tng | |
cp -a docs/dist/* www-releases/snapshots/tng | |
ls -l www-releases/snapshots/tng/ | |
- name: Get GitHub App User ID | |
id: get-user-id | |
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT" | |
env: | |
GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
- name: check for diff | |
id: www-releases | |
working-directory: ./www-releases | |
run: | | |
git diff-index --quiet HEAD || echo "has-diff=yes" >> "$GITHUB_OUTPUT" | |
- name: commit and push | |
working-directory: ./www-releases | |
run: | | |
git config user.name '${{ steps.app-token.outputs.app-slug }}[bot]' | |
git config user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>' | |
git add . | |
git add -u . | |
git commit --message "Update $NAME from $GITHUB_REPOSITORY" --message "Update tng docs from commit $GITHUB_SHA ($GITHUB_REF)" | |
git push |