ci: fix permissions #4
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: Pull Request | |
on: | |
push: | |
branches: | |
- develop | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
quality-checks-and-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Conventional Commits Check | |
if: github.event_name == 'pull_request' | |
uses: davidglezz/[email protected] | |
with: | |
target-branch: ${{ github.event.pull_request.base.ref }} | |
current-branch: ${{ github.event.pull_request.head.ref }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Prettier | |
run: npm run format-check | |
- name: Typecheck | |
run: npm run type-check | |
- name: Linter | |
run: npm run lint-check | |
- name: Unit test | |
run: npm run test | |
- name: Build | |
run: npm run build | |
- name: Fix permissions | |
run: | | |
chmod -c -R +rX "dist/" | while read line; do | |
echo "::warning title=Invalid file permissions automatically fixed::$line" | |
done | |
- uses: actions/upload-pages-artifact@v3 | |
if: github.event_name != 'pull_request' | |
with: | |
path: dist/ | |
deploy: | |
if: github.event_name != 'pull_request' | |
needs: quality-checks-and-build | |
runs-on: ubuntu-latest | |
# 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 }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |