Create release #443
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: Create release | |
on: | |
workflow_run: | |
workflows: | |
- Build | |
types: | |
- completed | |
branches: | |
- main | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
concurrency: | |
group: 'pages' | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: CD | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ssh-key: ${{ secrets.DEPLOY_KEY }} | |
- run: git fetch --all --tags | |
- uses: actions/setup-node@v3 | |
with: | |
registry-url: 'https://registry.npmjs.org' | |
cache: 'npm' | |
node-version-file: '.nvmrc' | |
- name: Install | |
run: npm ci | |
- name: Setup Git | |
run: | | |
git config --global user.email action@github.com | |
git config --global user.name GitHub Action | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Build | |
run: npm run build | |
- name: Test | |
run: npm run test | |
- name: Release | |
run: npm run release | |
env: | |
DEBUG: '*' | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
# Upload doc folder | |
path: './dist/docs' | |
# Deployment job | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |