Skip to content

Commit

Permalink
Improve Github Actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
piranna committed Jul 28, 2023
1 parent fc20e69 commit 015abaa
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
34 changes: 21 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,11 @@ jobs:
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- run: npm ci
- run: npm run test:json
- run: npm run docs
# Install dependencies
- run: npm ci --verbose

- uses: cpina/[email protected]
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
with:
destination-github-username: Mafalda-SFU
destination-repository-name: Mafalda-SFU.github.io
source-directory: docs
target-directory: docs/${{ github.event.repository.name }}
user-email: [email protected]
user-name: Mafalda bot
# Run tests and publish code coverage badge
- run: npm run test:json

- name: "Combine"
run: |
Expand All @@ -49,3 +40,20 @@ jobs:
maxColorRange: 90
namedLogo: Jest
valColorRange: ${{ env.total }}

# Publish docs
- run: npm run docs

- uses: cpina/[email protected]
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
with:
destination-github-username: Mafalda-SFU
destination-repository-name: Mafalda-SFU.github.io
source-directory: docs
target-directory: docs/${{ github.event.repository.name }}
user-email: [email protected]
user-name: Mafalda bot

# TODO: add steps to update the version using semantic-release, and
# publish to Github Packages and NPM
15 changes: 4 additions & 11 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@ on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci --verbose
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
Expand All @@ -25,7 +15,10 @@ jobs:
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci

- run: npm ci --verbose
- run: npm test

- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 comments on commit 015abaa

Please sign in to comment.