diff options
| author | Mo Bitar <76752051+mo8it@users.noreply.github.com> | 2025-05-23 13:26:52 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-23 13:26:52 +0200 |
| commit | 2267f996844475f45a96d9582e0ac0d40b4bce79 (patch) | |
| tree | 94d0634e928e553ba1071fa405b787efb586e84d /.github | |
| parent | e36dd7a1207ccf940ba820abc276fa465f45b531 (diff) | |
| parent | bf74a3d0a7ae3c0d12ba572fe1c2f1d711c6e530 (diff) | |
Merge pull request #2247 from rust-lang/website
Website
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/rust.yml | 16 | ||||
| -rw-r--r-- | .github/workflows/web.yml | 87 | ||||
| -rw-r--r-- | .github/workflows/website.yml | 42 |
3 files changed, 52 insertions, 93 deletions
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9a5d869..0317f35 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,10 +1,16 @@ -name: Rustlings Tests +name: Check on: push: branches: [main] + paths-ignore: + - website + - '*.md' pull_request: branches: [main] + paths-ignore: + - website + - '*.md' env: CARGO_TERM_COLOR: always @@ -14,14 +20,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - run: cargo clippy -- --deny warnings + - name: Clippy + run: cargo clippy -- --deny warnings fmt: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: DavidAnson/markdownlint-cli2-action@v16 - with: - globs: "exercises/**/*.md" - name: rustfmt run: cargo fmt --all --check test: @@ -40,4 +44,4 @@ jobs: - uses: actions/checkout@v4 - uses: swatinem/rust-cache@v2 - name: rustlings dev check - run: cargo run -- dev check --require-solutions + run: cargo dev check --require-solutions diff --git a/.github/workflows/web.yml b/.github/workflows/web.yml deleted file mode 100644 index ec5d446..0000000 --- a/.github/workflows/web.yml +++ /dev/null @@ -1,87 +0,0 @@ -# Workflow to build your docs with oranda (and mdbook) -# and deploy them to Github Pages -name: Web - -# We're going to push to the gh-pages branch, so we need that permission -permissions: - contents: write - -# What situations do we want to build docs in? -# All of these work independently and can be removed / commented out -# if you don't want oranda/mdbook running in that situation -on: - # Check that a PR didn't break docs! - # - # Note that the "Deploy to Github Pages" step won't run in this mode, - # so this won't have any side-effects. But it will tell you if a PR - # completely broke oranda/mdbook. Sadly we don't provide previews (yet)! - pull_request: - - # Whenever something gets pushed to main, update the docs! - # This is great for getting docs changes live without cutting a full release. - # - # Note that if you're using cargo-dist, this will "race" the Release workflow - # that actually builds the Github Release that oranda tries to read (and - # this will almost certainly complete first). As a result you will publish - # docs for the latest commit but the oranda landing page won't know about - # the latest release. The workflow_run trigger below will properly wait for - # cargo-dist, and so this half-published state will only last for ~10 minutes. - # - # If you only want docs to update with releases, disable this, or change it to - # a "release" branch. You can, of course, also manually trigger a workflow run - # when you want the docs to update. - push: - branches: - - main - - # Whenever a workflow called "Release" completes, update the docs! - # - # If you're using cargo-dist, this is recommended, as it will ensure that - # oranda always sees the latest release right when it's available. Note - # however that Github's UI is wonky when you use workflow_run, and won't - # show this workflow as part of any commit. You have to go to the "actions" - # tab for your repo to see this one running (the gh-pages deploy will also - # only show up there). - workflow_run: - workflows: [ "Release" ] - types: - - completed - -# Alright, let's do it! -jobs: - web: - name: Build and deploy site and docs - runs-on: ubuntu-latest - steps: - # Setup - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: swatinem/rust-cache@v2 - - # If you use any mdbook plugins, here's the place to install them! - - # Install and run oranda (and mdbook) - # This will write all output to ./public/ (including copying mdbook's output to there) - - name: Install and run oranda - run: | - curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/oranda/releases/download/v0.3.1/oranda-installer.sh | sh - oranda build - - # Deploy to our gh-pages branch (creating it if it doesn't exist) - # the "public" dir that oranda made above will become the root dir - # of this branch. - # - # Note that once the gh-pages branch exists, you must - # go into repo's settings > pages and set "deploy from branch: gh-pages" - # the other defaults work fine. - - name: Deploy to Github Pages - uses: JamesIves/github-pages-deploy-action@v4.4.1 - # ONLY if we're on main (so no PRs or feature branches allowed!) - if: ${{ github.ref == 'refs/heads/main' }} - with: - branch: gh-pages - # Gotta tell the action where to find oranda's output - folder: public - token: ${{ secrets.GITHUB_TOKEN }} - single-commit: true diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml new file mode 100644 index 0000000..4f758aa --- /dev/null +++ b/.github/workflows/website.yml @@ -0,0 +1,42 @@ +name: Website + +on: + push: + branches: [main] + paths: [website] + +jobs: + build: + defaults: + run: + working-directory: website + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install TailwindCSS + run: npm install + - name: Build CSS + run: npx @tailwindcss/cli -m -i input.css -o static/main.css + - name: Download Zola + run: curl -fsSL https://github.com/getzola/zola/releases/download/v0.20.0/zola-v0.20.0-x86_64-unknown-linux-gnu.tar.gz | tar xz + - name: Build site + run: ./zola build + - name: Upload static files as artifact + uses: actions/upload-pages-artifact@v3 + with: + path: public/ + + deploy: + needs: build + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + # Deploy to the github-pages environment + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + uses: actions/deploy-pages@v4 |
