Add links #157
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 Website on Release | |
| on: | |
| repository_dispatch: | |
| types: [electerm-release] | |
| push: | |
| branches: [ master ] | |
| workflow_dispatch: | |
| jobs: | |
| check-skip-ci: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_skip: ${{ steps.check.outputs.should_skip }} | |
| steps: | |
| - id: check | |
| name: Check if [skip ci] is in commit message | |
| run: | | |
| if echo "${{ github.event.head_commit.message || '' }}" | grep -i '\[skip ci\]'; then | |
| echo "should_skip=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "should_skip=false" >> $GITHUB_OUTPUT | |
| fi | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| needs: check-skip-ci | |
| if: needs.check-skip-ci.outputs.should_skip != 'true' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: npm i | |
| - name: Build site | |
| run: npm run b | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | |
| GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
| - name: Deploy to Vercel | |
| run: | | |
| npx vercel --prod --token "${{ secrets.VERCEL_TOKEN }}" --yes | |
| env: | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} |