feat: updates #23
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: Deploy pages | |
on: | |
workflow_dispatch: {} | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: webfactory/[email protected] | |
with: | |
ssh-private-key: | | |
${{ secrets.SLIDEV_THEME_LIATRIO_DEPLOY_KEY }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
- name: Install dependencies | |
run: npm install | |
- name: Build | |
run: npm run build | |
- uses: actions/configure-pages@v4 | |
- uses: actions/upload-pages-artifact@v3 | |
with: | |
path: dist | |
- name: Deploy | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
- name: Bump version and push tag | |
id: tag_version | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Configure Git | |
run: | | |
git config --global user.email "${GITHUB_ACTOR}" | |
git config --global user.name "${GITHUB_ACTOR}@users.noreply.github.com" | |
- name: Generate PDF | |
run: | | |
npm run export | |
REPO=$(echo "${{ github.repository }}" | awk -F '/' '{print $2}') | |
mv *-export.pdf $REPO-${{ steps.tag_version.outputs.new_tag }}.pdf | |
- name: Create GitHub Release | |
env: | |
GH_TOKEN: ${{ github.token }} | |
TAG: ${{ steps.tag_version.outputs.new_tag }} | |
run: | | |
git tag -a "${TAG}" -m "release $TAG" | |
gh release create "${TAG}" *.pdf \ | |
--generate-notes \ | |
--target "$(git rev-parse HEAD)" |