diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..8ac6b8c4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" diff --git a/.github/workflows/doc.nuxeo.com.yml b/.github/workflows/doc.nuxeo.com.yml new file mode 100644 index 00000000..f765065a --- /dev/null +++ b/.github/workflows/doc.nuxeo.com.yml @@ -0,0 +1,77 @@ +name: Build and Deploy doc.nuxeo.com + +on: + push: + branches: + - master + - development + - master-nx-assets + +jobs: + documentation_ci: + name: Build & Publish documentation to ${{ github.ref_name == 'master' && 'production' || 'development' }} + runs-on: doc + environment: + name: ${{ github.ref_name == 'master' && 'production' || 'development' }} + steps: + + - name: Configure SSH client + run: | + echo "$SSH_CONFIG" >> $HOME/.ssh/config + env: + SSH_CONFIG: "${{ secrets.SSH_CONFIG }}" + + - name: Set up SSH + uses: webfactory/ssh-agent@d4b9b8ff72958532804b70bbe600ad43b36d5f2e # v0.8.0 + with: + ssh-private-key: ${{ secrets.SERVER_SSH_PRIVATE_KEY }} + + - name: Checkout code + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Set up Node.js + uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 + with: + node-version: '14' + + - name: Check Versions and Save to File + run: | + echo "git $(git --version)" > runtime-versions.txt + echo "node version $(node --version)" >> runtime-versions.txt + echo "npm version $(npm --version)" >> runtime-versions.txt + echo "IP $(curl -s ipinfo.io/ip)" >> runtime-versions.txt + + - name: Install dependencies + run: npm ci --registry="https://registry.npmjs.org" || npm install --registry="https://registry.npmjs.org" + + - name: Build + env: + ALGOLIA_KEY: ${{ secrets.NX_TOKEN }} + DEBUG_FILE_LEVEL: debug + run: npm start + + - name: Generate Nginx Redirects + run: | + bin/redirects-yml2nginx > redirects.txt + echo > redirects_pageid.txt + + - name: Deploy to Server + run: | + rsync -Wxvurk --delete site/ "${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }}:/opt/www/doc/" + rsync redirects.txt "${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }}:/etc/nginx/redirects.txt" + rsync redirects_pageid.txt ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }}:/etc/nginx/redirects_pageid.txt + + - name: Nginx Config Test and Restart + run: | + ssh "${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }}" \ + "service nginx configtest && service nginx restart" + + - name: Archive Artifacts + uses: actions/upload-artifact@v3 + with: + name: build-artifacts + path: | + redirects_pageid.* + redirects.* + *.txt + npm-debug.log diff --git a/config.yml b/config.yml index 8d46e096..18f95f8d 100644 --- a/config.yml +++ b/config.yml @@ -17,8 +17,6 @@ default: - '**.DS_Store' - '*~' - '*.swp' - nx_assets_url: https://intranet.nuxeo.com/nuxeo - # nx_assets_url: http://intranet-preprod.nuxeocloud.com/nuxeo canonical_version_preference: 'LTS 2019' new_version: '10.10' @@ -67,28 +65,28 @@ default: platform: url: git@github.com:nuxeo/doc.nuxeo.com-content.git branches: - static: + 'static-nx-assets': no_versioning: true design: no_versioning: true - '2023': + '2023-nx-assets': label: 'LTS 2023' order: 10 - '2021': + '2021-nx-assets': label: 'LTS 2021' order: 20 url_path: '2021' - '1010': + '1010-nx-assets': label: 'LTS 2019' noindex: true order: 30 url_path: '1010' - '910': + '910-nx-assets': label: 'LTS 2017' noindex: true order: 40 url_path: '910' - '810': + '810-nx-assets': label: 'LTS 2016' noindex: true order: 50 @@ -101,68 +99,68 @@ default: label: 'none' noindex: true url_path: '60' - master: + 'master-nx-assets': label: 'none' noindex: true url_path: 'master' java: url: git@github.com:nuxeo/doc.nuxeo.com-client-java.git branches: - '3.13': + '3.13-nx-assets': label: '3.13' url_path: '3.13' order: 0 - '3.12': + '3.12-nx-assets': label: '3.12' url_path: '3.12' noindex: true order: 10 - '3.11': + '3.11-nx-assets': label: '3.11' url_path: '3.11' noindex: true order: 20 - '3.10': + '3.10-nx-assets': label: '3.10' url_path: '3.10' noindex: true order: 30 - '3.9': + '3.9-nx-assets': label: '3.9' url_path: '3.9' noindex: true order: 40 - '3.8': + '3.8-nx-assets': label: '3.8' url_path: '3.8' noindex: true order: 50 - '3.7': + '3.7-nx-assets': label: '3.7' url_path: '3.7' noindex: true order: 60 - '3.6': + '3.6-nx-assets': label: '3.6' url_path: '3.6' noindex: true order: 70 - '3.5': + '3.5-nx-assets': label: '3.5' url_path: '3.5' noindex: true order: 80 - '3.4': + '3.4-nx-assets': label: '3.4' url_path: '3.4' noindex: true order: 90 - '3.3': + '3.3-nx-assets': label: '3.3' url_path: '3.3' noindex: true order: 100 - '3.2': + '3.2-nx-assets': label: '3.2' url_path: '3.2' noindex: true diff --git a/docs/writing-documentation.md b/docs/writing-documentation.md index 24a319e7..118744e7 100644 --- a/docs/writing-documentation.md +++ b/docs/writing-documentation.md @@ -43,22 +43,12 @@ cd doc.nuxeo.com-content #### Run Locally -You will need your Nuxeo Intranet credentials for the screenshots to display correctly. - ```bash -NX_ASSETS_USER='{username}' NX_ASSETS_PWD='{password}' npm run dev +npm run dev ``` -Make sure to replace `{username}` and `{password}` with your credentials. - Once started, http://localhost:3000 opens automatically. Browse to the URL you want to see your changes. -If the screenshots aren't a concern, you can run locally without the `NX_ASSETS_...` credentials: - -```bash -npm run dev -``` - If you want to skip the initial build and use the existing one as the base, you can do: ```bash @@ -106,15 +96,15 @@ See [main project trouble shooting](https://github.com/nuxeo/doc.nuxeo.com/blob/ # Create a Page -**FROM GITHUB UI** +**FROM GITHUB UI** -You can create a new page from GitHub UI: +You can create a new page from GitHub UI: -1. Go to the folder on GitHub where you want your page to be created (for example if you want to add a new page under [Web UI](https://doc.nuxeo.com/nxdoc/web-ui), the new page will have to be created [here](https://github.com/nuxeo/doc.nuxeo.com-content/tree/master/src/nxdoc/web-ui)). +1. Go to the folder on GitHub where you want your page to be created (for example if you want to add a new page under [Web UI](https://doc.nuxeo.com/nxdoc/web-ui), the new page will have to be created [here](https://github.com/nuxeo/doc.nuxeo.com-content/tree/master/src/nxdoc/web-ui)). -2. Click on **Create new file** at the top of the table +2. Click on **Create new file** at the top of the table -3. A blank page is displayed, copy paste the content in the [new-page-template.md](new-page-template.md). +3. A blank page is displayed, copy paste the content in the [new-page-template.md](new-page-template.md). 4. Make sure to give your page a title and to name your file `.md` @@ -328,7 +318,7 @@ These require us to use the reference style of links: ### To Images -Most of the screenshots are stored in the Intranet under [this folder](https://intranet.nuxeo.com/nuxeo/ui/#!/doc/4af58911-f0b1-4a79-a517-4fdde449478e). +Most of the screenshots are stored in the Intranet under [this folder](https://intranet.nuxeo.com/nuxeo/ui/#!/doc/4af58911-f0b1-4a79-a517-4fdde449478e). **Add a New Screenshot** @@ -342,18 +332,18 @@ Most of the screenshots are stored in the Intranet under [this folder](https://i 2. Go to the existing folder named after the title of the documentation page concerned. 3. Click on **Create** > **DOCASSET**. 4. Fill in the metadata related to your screenshot and click on Create.
- Your screenshot document is created. + Your screenshot document is created. 5. You will see an Asset markdown snippet section under the preview of your screenshot with a generated unique ID. -6. Make sure to select **Use border** and **Override size** to adjust the size of your screenshot.
- Generally, an icon is 20px, a pop-up 350px and a screenshot is 650px (that's the max size for a screenshot). -7. Click on the copy icon next to the snippet section and paste it on the documentation page. +6. Make sure to select **Use border** and **Override size** to adjust the size of your screenshot.
+ Generally, an icon is 20px, a pop-up 350px and a screenshot is 650px (that's the max size for a screenshot). +7. Click on the copy icon next to the snippet section and paste it on the documentation page. **Update an Existing Screenshot** 1. Go to the existing folder named after the title of the documentation page concerned 2. Find the screenshot that you want to replace -3. Click on the **Replace** icon under the preview of the screenshot. -4. The screenshot ID won't change so once the doc build will be redeployed it will fetch the updated screenshot. +3. Click on the **Replace** icon under the preview of the screenshot. +4. The screenshot ID won't change so once the doc build will be redeployed it will fetch the updated screenshot. +-->