Merge pull request #8 from schubergphilis/bugfix/date-check #14
This file contains hidden or 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: Deploy Frontend | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| frontend-ci: | |
| environment: prod | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{github.head_ref}} | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: "pnpm" | |
| cache-dependency-path: "**/pnpm-lock.yaml" | |
| always-auth: true | |
| scope: '@schubergphilis' | |
| registry-url: 'https://npm.pkg.github.com' | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: "Setup git user" | |
| run: | | |
| git config user.name "GitHub Actions" | |
| git config user.email "<>" | |
| - name: Install dependencies | |
| working-directory: sbp-frontend-style | |
| run: pnpm install | |
| - name: Build component list | |
| working-directory: sbp-frontend-style | |
| run: pnpm prebuild | |
| - name: Run Tests | |
| working-directory: sbp-frontend-style | |
| run: pnpm test | |
| - name: Build project | |
| working-directory: sbp-frontend-style | |
| run: pnpm build | |
| env: | |
| GENERATE_SOURCEMAP: "false" | |
| - name: Create release version | |
| working-directory: sbp-frontend-style | |
| run: yarn version --minor --no-git-tag-version | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract version from package.json | |
| working-directory: sbp-frontend-style | |
| id: pkg | |
| run: echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT | |
| - name: Check-in new version | |
| run: | | |
| git add . | |
| git commit -m "chore: bump version to v${{ steps.pkg.outputs.version }} [skip ci]" | |
| git push | |
| - name: Package project | |
| working-directory: sbp-frontend-style | |
| run: pnpm pack && pnpm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: release-drafter/release-drafter@v6 | |
| # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml | |
| with: | |
| tag: v${{ steps.pkg.outputs.version }} | |
| name: v${{ steps.pkg.outputs.version }} | |
| version: ${{ steps.pkg.outputs.version }} | |
| publish: true | |
| # config-name: my-config.yml | |
| # disable-autolabeler: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |