Skip to content

Commit

Permalink
ci: fix release workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Emilien Escalle <[email protected]>
  • Loading branch information
neilime committed Aug 30, 2024
1 parent 5c239a2 commit 1cf7594
Showing 1 changed file with 40 additions and 25 deletions.
65 changes: 40 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ jobs:
needs: ci
runs-on: ubuntu-latest
environment: github-pages
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PRIVATE_ACCESS_TOKEN }}

- uses: hoverkraft-tech/ci-github-nodejs/actions/[email protected]

Expand All @@ -25,37 +26,51 @@ jobs:
name: build
path: /

- name: πŸ”– Configure publish
env:
NPM_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
git config --local user.email "${{ github.actor }}@users.noreply.github.com"
git config --local user.name "${{ github.actor }}"
- uses: googleapis/release-please-action@v4
with:
release-type: node
skip-github-pull-request: true

- name: πŸ“¦ Publish NPM packages
env:
GH_TOKEN: ${{ secrets.GH_PRIVATE_ACCESS_TOKEN }}
run: |
npx standard-version
NPM_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
run: npm publish --access public

echo `git add -A && git commit -m "chore: prepare release"`
git push --follow-tags origin ${{ github.event.repository.default_branch }}
docs-publish:
name: Publish documentation
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: ci
steps:
- uses: actions/checkout@v4

npm publish --access public
- uses: actions/download-artifact@v4
with:
name: build
path: /

- name: 🌐 Publish to gh-pages
run: |
- run: |
mkdir -p /tmp
cp -R build/docs /tmp/publish
cp -R docs /tmp/publish/
- name: 🌐 Publish Github pages
uses: peaceiris/[email protected]
- name: βš™οΈ Setup Pages
uses: actions/configure-pages@v5

- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: /tmp/publish
enable_jekyll: true
user_name: ${{ github.actor }}
user_email: ${{ github.actor }}@users.noreply.github.com
source: ./
destination: ./_site

- name: Upload artifact
uses: actions/upload-pages-artifact@v3

- name: πŸš€ Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 1cf7594

Please sign in to comment.