From 0c3321626460967e0ee2850ca91e3050938074b9 Mon Sep 17 00:00:00 2001 From: "kerem.acer" Date: Fri, 18 Oct 2024 11:20:48 +0300 Subject: [PATCH] Add workflows --- .github/workflows/deploy.yml | 49 +++++++++++++++++++++++++++++ .github/workflows/test-deploy.yml | 24 ++++++++++++++ versioned_docs/version-1.0/index.md | 2 +- 3 files changed, 74 insertions(+), 1 deletion(-) 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..83cfb96 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,49 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - main + +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..b43b94e --- /dev/null +++ b/.github/workflows/test-deploy.yml @@ -0,0 +1,24 @@ +name: Test deployment + +on: + pull_request: + branches: + - main + +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/versioned_docs/version-1.0/index.md b/versioned_docs/version-1.0/index.md index 45e8604..566e979 100644 --- a/versioned_docs/version-1.0/index.md +++ b/versioned_docs/version-1.0/index.md @@ -42,6 +42,6 @@ npm run start The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there. -The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/. +The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at . Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes.