Skip to content

Workflow file for this run

name: Publish package to Npmjs and notify on Mattermost
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
env:
DEPLOYMENT_URL: https://datasupr.staging.dataesr.ovh
MM_NOTIFICATION_CHANNEL: 'bots'
permissions:
contents: read
pages: write
id-token: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
scope: '@dataesr'
- run: npm ci
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
deploy-examples:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '20.x'
cache: 'npm'
- name: Install dependencies and Build
run: npm ci --silent && npm run build && cd ./example-ts && npm run build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload build repository
path: './example-ts/build'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
notify:
needs: publish
if: always()
runs-on: ubuntu-latest
steps:
- uses: dataesr/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN}}
mattermost_webhook_url: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
mattermost_channel: ${{ env.MM_NOTIFICATION_CHANNEL}}
deployment_url: ${{ env.DEPLOYMENT_URL }}