feat: improving PR experience with comments #66
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: CI - Pull Request | |
on: pull_request | |
# Pull Request Runs on the same branch will be cancelled | |
concurrency: | |
group: ${{ github.head_ref }} | |
cancel-in-progress: true | |
jobs: | |
code-quality: | |
name: Check the code quality | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.head_ref }} | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x.x | |
cache: "npm" | |
- name: Code Quality | |
uses: ZebraDevs/web-components-code-quality@action-setup | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
generate-localizations: | |
name: Generate localizations. | |
needs: [code-quality] | |
timeout-minutes: 20 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x.x | |
cache: "npm" | |
- name: Install dependencies | |
run: npm ci | |
- name: Run lit-localize extract | |
run: npm run localize:extract | |
- name: Run lit-localize build | |
run: npm run localize:build | |
- name: Check diff | |
id: diff | |
run: git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT | |
- name: Commit files | |
if: steps.diff.outputs.changed == 'true' | |
run: | | |
git config --global user.name 'github-actions' | |
git config --global user.email '[email protected]' | |
git add . | |
git commit -m "Generated locales" | |
git push | |
deploy-preview: | |
timeout-minutes: 20 | |
name: Deploy preview version of the storybook on firebase | |
needs: [generate-localizations] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x.x | |
cache: "npm" | |
- name: Install dependencies | |
run: npm ci | |
- name: Create custom-elements.json | |
run: npm run analyze | |
- name: Build storybook | |
run: npm run storybook:build | |
- uses: FirebaseExtended/action-hosting-deploy@v0 | |
with: | |
repoToken: "${{ secrets.GITHUB_TOKEN }}" | |
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZETA_DS }}" | |
expires: 7d | |
channelId: "pr-${{ github.event.number }}-${{ github.event.pull_request.head.ref }}" |