-
-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4017390
commit 394c87a
Showing
1 changed file
with
41 additions
and
12 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,55 @@ | ||
name: Release | ||
|
||
permissions: | ||
contents: write | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
- 'v*.*.*' # Trigger the workflow on tags like v1.0.0, v1.1.0, etc. | ||
|
||
jobs: | ||
release: | ||
name: Build and Release Algo Site | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set node | ||
uses: actions/setup-node@v4 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
node-version: '16' | ||
|
||
- run: npx changelogithub | ||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build Algo site | ||
run: npm run build | ||
|
||
- name: Generate Release Notes | ||
id: release_notes | ||
uses: release-drafter/release-drafter@v5 | ||
with: | ||
config-name: '.github/release-drafter.yml' # Requires a Release Drafter config | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create GitHub Release | ||
id: create_release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ github.ref_name }} # Tag name from the push event | ||
release_name: ${{ github.ref_name }} | ||
body: ${{ steps.release_notes.outputs.body }} | ||
draft: false | ||
prerelease: false | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Upload Built Site (Optional) | ||
uses: actions/upload-release-asset@v1 | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: build # Directory containing built static site files (Algo build output) | ||
asset_name: algo-site.zip | ||
asset_content_type: application/zip | ||
|
||
# Optionally, you could add additional jobs here to deploy to GitHub Pages if needed |