Skip to content

docs: moving image #193

docs: moving image

docs: moving image #193

Workflow file for this run

# This is the workflow for deploying the smile docs
name: DOCS_DEPLOY
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches:
- main
paths:
- 'docs/**'
- '.github/workflows/docs-deploy.yml'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: smile-docs
cancel-in-progress: false
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "deploy"
deploy:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main
# setup node.js
- name: Setup node.js
uses: actions/setup-node@v4
with:
node-version-file: '.node_version'
# install node packages
- name: Install node dependencies
run: npm install
- name: Rebuild docs
run: npm run docs:build
# Deploy files to web server
- name: rsync to server
uses: burnett01/rsync-deployments@5.2
with:
switches: -avrz --delete
path: docs/.vitepress/dist/
remote_path: ${{ secrets.DOCS_DEPLOY_PATH }}
remote_host: ${{ secrets.DOCS_DEPLOY_HOST }}
remote_port: ${{ secrets.DOCS_DEPLOY_PORT }}
remote_user: ${{ secrets.DOCS_DEPLOY_USER }}
remote_key: ${{ secrets.DOCS_DEPLOY_KEY }}
# send a notification at the end
- name: Send notification to lab slack
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: ${{ env.SLACK_WEBHOOK_URL != '' }} # this should only run if SLACK_WEBHOOK exists
id: slack
uses: slackapi/slack-github-action@v1.25.0
with:
# This data can be any valid JSON from a previous step in the GitHub Action
payload: |
{
"github_username": "${{ github.actor }}",
"deploy_url": "Docs were updated as https://smile.gureckislab.org/",
"github_hash": "https://github.com/${{ steps.dotenv_github.outputs.VITE_GIT_OWNER }}/${{ steps.dotenv_github.outputs.VITE_GIT_REPO_NAME }}/commit/${{ steps.dotenv_github.outputs.VITE_GIT_HASH }}"
}