From 598ffff3d6632f14019fed5a9f44e90f5e894770 Mon Sep 17 00:00:00 2001 From: Tantic Date: Sun, 8 Sep 2024 09:54:47 +0200 Subject: [PATCH] add github actions Signed-off-by: Tantic --- .github/workflows/deploy.yml | 51 +++++++++++++++++++++++++++++++ .github/workflows/test-deploy.yml | 26 ++++++++++++++++ docusaurus.config.js | 12 ++++---- 3 files changed, 83 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/test-deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..d2e9e23 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,51 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - main + # Review gh actions docs if you want to further define triggers, paths, etc + # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on + +jobs: + build: + name: Build Docusaurus + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: 18 + cache: yarn + + - name: Install dependencies + run: yarn install --frozen-lockfile + - name: Build website + run: yarn build + + - name: Upload Build Artifact + uses: actions/upload-pages-artifact@v3 + with: + path: build + + deploy: + name: Deploy to GitHub Pages + needs: build + + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + + # Deploy to the github-pages environment + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml new file mode 100644 index 0000000..24eb603 --- /dev/null +++ b/.github/workflows/test-deploy.yml @@ -0,0 +1,26 @@ +name: Test deployment + +on: + pull_request: + branches: + - main + # Review gh actions docs if you want to further define triggers, paths, etc + # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on + +jobs: + test-deploy: + name: Test deployment + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: 18 + cache: yarn + + - name: Install dependencies + run: yarn install --frozen-lockfile + - name: Test build website + run: yarn build \ No newline at end of file diff --git a/docusaurus.config.js b/docusaurus.config.js index f9fb1f3..44a2b48 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -8,20 +8,20 @@ import {themes as prismThemes} from 'prism-react-renderer'; /** @type {import('@docusaurus/types').Config} */ const config = { - title: 'My Site', - tagline: 'Dinosaurs are cool', + title: 'Redmine Asap Docs', + tagline: 'Documentation about Redmine Asap suite and Redmine in general', favicon: 'img/favicon.ico', // Set the production url of your site here - url: 'https://your-docusaurus-site.example.com', + url: 'https://redmine_asap_docs.github.io', // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' baseUrl: '/', // GitHub pages deployment config. // If you aren't using GitHub pages, you don't need these. - organizationName: 'facebook', // Usually your GitHub org/user name. - projectName: 'docusaurus', // Usually your repo name. + organizationName: 'tantic', // Usually your GitHub org/user name. + projectName: 'redmine_asap_docs', // Usually your repo name. onBrokenLinks: 'throw', onBrokenMarkdownLinks: 'warn', @@ -74,7 +74,7 @@ const config = { // Replace with your project's social card image: 'img/docusaurus-social-card.jpg', navbar: { - title: 'My Site', + title: 'Redmine Asap Docs', logo: { alt: 'My Site Logo', src: 'img/logo.svg',