Add lit-a11y/list to eslint-plugin-lit-a11y docs/../overview.md #2321
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
name: Preview | |
on: pull_request | |
jobs: | |
release: | |
# Prevents changesets action from creating a PR on forks | |
if: github.repository == 'open-wc/open-wc' | |
name: Preview | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
with: | |
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | |
fetch-depth: 0 | |
- name: Setup Node.js 20 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
cache: 'npm' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install Dependencies | |
run: npm ci | |
- name: Get the slugified branch name | |
run: | | |
branch=$(npx slugify-cli ${GITHUB_HEAD_REF}) | |
echo ::set-output name=name::$branch | |
id: slugified_branch | |
- name: Build the preview URL from the branch name | |
run: echo ::set-output name=url::https://${{steps.slugified_branch.outputs.name}}--open-wc-org.netlify.app/ | |
id: preview | |
- name: Build Documentation Site | |
env: | |
DEPLOY_URL: ${{ steps.preview.outputs.url }} | |
CONTEXT: deploy-preview | |
run: npm run site:build | |
- name: Publish to Netlify | |
env: | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
run: npx netlify deploy --alias=${{steps.slugified_branch.outputs.name}} --dir=_site | |
- name: Post Previews | |
uses: actions/github-script@v6 | |
env: | |
PREVIEW_URL: ${{ steps.preview.outputs.url }} | |
with: | |
script: | | |
const body = `Preview published to [${process.env.PREVIEW_URL}](${process.env.PREVIEW_URL}).`; | |
github.rest.issues.listComments({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.issue.number, | |
}).then(({data}) => { | |
const priorComment = data.find(comment => comment.body.startsWith('Preview published to')); | |
if (priorComment) { | |
github.rest.issues.updateComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
comment_id: priorComment.id, | |
body | |
}); | |
} else { | |
github.rest.issues.createComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.issue.number, | |
body | |
}); | |
} | |
}); |