From 955d1fa9fbfe3507a6138f6c3ce794531cf1967e Mon Sep 17 00:00:00 2001 From: Isaac Shek Date: Tue, 19 Sep 2023 22:54:45 +0100 Subject: [PATCH] feat(): add workflow file and update variable --- .env | 3 -- .github/workflows/deployment.yml | 49 ++++++++++++++++++++++++++++++++ .gitignore | 1 + docusaurus.config.js | 6 ++-- 4 files changed, 53 insertions(+), 6 deletions(-) delete mode 100644 .env create mode 100644 .github/workflows/deployment.yml diff --git a/.env b/.env deleted file mode 100644 index bda6bd10a..000000000 --- a/.env +++ /dev/null @@ -1,3 +0,0 @@ -DOCSEARCH_APP_ID="HZJPMBSKK3" -DOCSEARCH_API_KEY="6b3dcd0dbf85334a8c18a2d62f1bff35" -DOCSEARCH_INDEX_NAME="stacks-amido" diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml new file mode 100644 index 000000000..11a95fdc2 --- /dev/null +++ b/.github/workflows/deployment.yml @@ -0,0 +1,49 @@ +name: stacks.website +​ +on: + push: + paths: + - 'src/**' + pull_request: + branches: + - master + - feat/ensono-rebrand + - feat/testing-deployment +​ +jobs: + build-and-deploy: + name: Build and Deploy to GitHub Pages + runs-on: ubuntu-latest +​ + steps: +​ + # Checkout the documentation repository + - name: Checkout Repo + uses: actions/checkout@v4 +​ + # Configure node so that the build can run + - name: Use NodeJS + uses: actions/setup-node@v4 + with: + node-version: '16.14.x' +​ + # Install Node dependencies + - name: Install Dependencies + run: npm install +​ + # Build the website + - name: Generate Website + run: npm run build + env: + # Secrets from GitHub go here + ALGOLIA_INDEX_NAME: ${{ secrets.ALGOLIA_INDEX_NAME }} + ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} + ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} +​ + # Deploy to GHitHub Pages + - name: Deploy to GitHub Pages + uses: JamesIves/github-pages-deploy-action@4.3.3 + with: + branch: gh-pages + folder: build + clean: true \ No newline at end of file diff --git a/.gitignore b/.gitignore index ec0c9f140..7f87d1d25 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ yarn-debug.log* yarn-error.log* .vscode/* .vs/* +.env \ No newline at end of file diff --git a/docusaurus.config.js b/docusaurus.config.js index 25f824127..9ff6b98b2 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -50,9 +50,9 @@ const config = { "OWASP", ], docSearch: { - appId: process.env.DOCSEARCH_APP_ID, - apiKey: process.env.DOCSEARCH_API_KEY, - indexName: process.env.DOCSEARCH_INDEX_NAME, + appId: process.env.ALGOLIA_APP_ID, + apiKey: process.env.ALGOLIA_API_KEY, + indexName: process.env.ALGOLIA_INDEX_NAME, } }, themeConfig: {