Fix permissions in deploy workflow #4
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: Tag and Release Workflow | |
on: | |
pull_request: | |
types: | |
- closed | |
concurrency: | |
group: 'pages' | |
cancel-in-progress: false | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
if: startsWith(github.event.pull_request.title, 'Release:') | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Build and Deploy | |
run: npm run deploy | |
- name: Set up Git | |
run: | | |
git config user.name "kelseymorsebrown" | |
git config user.email "[email protected]" | |
- name: Get tag | |
id: get_tag | |
run: | | |
git branch --show-current | |
git pull | |
echo "version=v$(npm pkg get version | tr -d '\"')" >> $GITHUB_OUTPUT | |
- name: Tag the commit | |
run: | | |
next_version=${{ steps.get_tag.outputs.version }} | |
git tag -a "$next_version" -m "Version $next_version" | |
git push --follow-tags | |
- name: Create changelog diff | |
id: changelog_diff | |
run: | | |
sed -n "/^## \[${{ steps.get_tag.outputs.version }}\]/,/^## \[$(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1))\]/{/^## \[$(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1))\]/!p;}" CHANGELOG.md > release_notes.md | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.get_tag.outputs.version }} | |
release_name: Release ${{ steps.get_tag.outputs.version }} | |
body_path: ./release_notes.md | |
draft: false | |
prerelease: false | |
- name: Delete release_notes file | |
run: rm release_notes.md |