diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..36464b0 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,63 @@ +name: Deploy Docusaurus to GitHub Pages + +on: + push: + branches: + - main + + workflow_dispatch: +permissions: + contents: write + +jobs: + build: + name: Build Docusaurus + runs-on: ubuntu-latest + + steps: + - name: Checkout main + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 20 + cache: "npm" + + - name: Install dependencies + run: npm install + + - name: Lint Markdown Files + run: | + npx markdownlint '../../docs/**/*.md' + + - name: Build the website + run: npm run build + + - name: Upload Build Artifact + uses: actions/upload-pages-artifact@v3 + with: + path: build + + + deploy: + name: Deploy to GitHub Pages + needs: build + + permissions: + pages: write + id-token: write + + environment: + name: github-pages + + runs-on: ubuntu-latest + + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + env: + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml deleted file mode 100644 index f2b1e66..0000000 --- a/.github/workflows/pages.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Publish docs via GitHub Pages - -# Controls when the action will run -on: - push: - branches: - - main - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: -permissions: - contents: write -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - build: - name: Deploy docs - runs-on: ubuntu-latest - steps: - - name: Checkout master - uses: actions/checkout@v4 - - - name: Deploy docs - uses: mhausenblas/mkdocs-deploy-gh-pages@master - # Or use mhausenblas/mkdocs-deploy-gh-pages@nomaterial to build without the mkdocs-material theme - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CUSTOM_DOMAIN: docs.magistrala.abstractmachines.fr diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml new file mode 100644 index 0000000..b0853e6 --- /dev/null +++ b/.github/workflows/test-deploy.yml @@ -0,0 +1,32 @@ +name: Test deployment + +on: + pull_request: + branches: + - main + +jobs: + test-deploy: + name: Test deployment + runs-on: ubuntu-latest + steps: + - name: Checkout main + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "npm" + + - name: Install dependencies + run: npm install + + - name: Lint Markdown Files + run: | + npx markdownlint '../../docs/**/*.md' + + - name: Test Build the website + run: npm run build