Skip to content

Commit 40eb413

Browse files
authored
Merge branch 'main' into martab1994-portenta-x8-revamp
2 parents 645beb6 + ea83013 commit 40eb413

File tree

513 files changed

+12779
-2628
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

513 files changed

+12779
-2628
lines changed

.github/workflows/deploy-prd.yml

Lines changed: 0 additions & 75 deletions
This file was deleted.
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Deploy to docs-content.arduino.cc
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
concurrency:
10+
group: deploy-production
11+
cancel-in-progress: true
12+
13+
permissions:
14+
id-token: write
15+
contents: read
16+
17+
jobs:
18+
build:
19+
if: "github.repository == 'arduino/docs-content'"
20+
runs-on: ubuntu-latest
21+
environment: production
22+
env:
23+
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
24+
APP_ENV: prod
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 1
30+
- uses: actions/setup-node@v4
31+
with:
32+
node-version: 18
33+
cache: "npm"
34+
cache-dependency-path: "**/package-lock.json"
35+
36+
- name: Render Datasheets
37+
run: cd ${GITHUB_WORKSPACE}/scripts/datasheet-rendering;./render-datasheets.sh
38+
39+
- name: Copy Static Files
40+
run: |
41+
mkdir -p static/resources/datasheets static/resources/schematics static/resources/pinouts static/resources/models
42+
find ./content/hardware -type f -name "*-schematics.pdf" -exec cp {} ./static/resources/schematics/ \;
43+
find ./content/hardware -type f -name "*-datasheet.pdf" -exec cp {} ./static/resources/datasheets/ \;
44+
find ./content/hardware -type f -name "*-full-pinout.pdf" -exec cp {} ./static/resources/pinouts/ \;
45+
find ./content/hardware -type f -name "*-pinout.png" -exec cp {} ./static/resources/pinouts/ \;
46+
find ./content/hardware -type f -name "*-step.zip" -exec cp {} ./static/resources/models/ \;
47+
48+
- name: Gatsby main cache
49+
uses: actions/cache@v4
50+
id: gatsby-cache-folder
51+
with:
52+
path: .cache
53+
key: ${{ runner.os }}-cache-gatsby-${{ github.ref_name }}
54+
restore-keys: |
55+
${{ runner.os }}-cache-gatsby-main
56+
57+
- name: Gatsby Public Folder
58+
uses: actions/cache@v4
59+
id: gatsby-public-folder
60+
with:
61+
path: public/
62+
key: ${{ runner.os }}-public-gatsby-${{ github.ref_name }}
63+
restore-keys: |
64+
${{ runner.os }}-public-gatsby-main
65+
66+
- run: npm install
67+
- run: npm run build
68+
69+
- name: Clean up node_modules
70+
run: rm -rf node_modules
71+
72+
- name: Configure AWS credentials from Production account
73+
uses: aws-actions/configure-aws-credentials@v4
74+
with:
75+
role-to-assume: ${{ secrets.PRODUCTION_IAM_ROLE }}
76+
aws-region: us-east-1
77+
78+
- name: Sync all cacheable assets
79+
run: aws s3 sync --cache-control "public, max-age=31536000, immutable" --include "*.css" --include="*.js" --include="*.gif" --include="*.png" --include="*.svg" --exclude "*.html" --exclude="sw.js" --exclude="*.json" --exclude="*.pdf" --delete public/ s3://${{ secrets.PRODUCTION_BUCKET_NAME }}/
80+
81+
- name: Sync all non-cacheable assets
82+
# Don't cache any HTML or JSON file: they should always be up-to-dates
83+
run: aws s3 sync --cache-control "public, max-age=0, must-revalidate" --include "*.html" --include="sw.js" --include="*.json" --include "*.css" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --exclude="*.pdf" --delete public/ s3://${{ secrets.PRODUCTION_BUCKET_NAME }}/
84+
85+
# - name: Sync PDF
86+
# run: aws s3 sync --cache-control "public, max-age=86400, must-revalidate" --include "*.pdf" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --exclude="*.css" --exclude="*.html" --exclude="*.json" --exclude="sw.json" --delete public/ s3://${{ secrets.PRODUCTION_BUCKET_NAME }}/
87+
88+
# - name: Purge cache on CloudFlare
89+
# run: |
90+
# curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE }}/purge_cache" \
91+
# -H "Authorization: Bearer ${{ secrets.CLOUDFLARE_PURGE_API_TOKEN }}" \
92+
# -H "Content-Type: application/json" \
93+
# --data '{"prefixes":["${{ vars.DATASHEETS_BASE_URL }}"]}'
94+
95+
- name: Sync all cacheable assets
96+
run: aws s3 sync --cache-control "public, max-age=31536000, immutable" --include "*.css" --include="*.js" --include="*.gif" --include="*.png" --include="*.svg" --exclude "*.html" --exclude="sw.js" --exclude="*.json" --delete public/ s3://${{ secrets.PRODUCTION_BUCKET_NAME }}/
97+
98+
- name: Sync all non-cacheable assets
99+
# Don't cache any HTML or JSON file: they should always be up-to-dates
100+
run: aws s3 sync --cache-control "public, max-age=0, must-revalidate" --include "*.html" --include="sw.js" --include="*.json" --include "*.css" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --delete public/ s3://${{ secrets.PRODUCTION_BUCKET_NAME }}/

.github/workflows/deploy-staging.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Deploy to docs-content.oniudra.cc
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- ghaction
8+
9+
concurrency:
10+
group: deploy-staging
11+
cancel-in-progress: true
12+
13+
permissions:
14+
id-token: write
15+
contents: read
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
environment: staging
21+
env:
22+
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
23+
APP_ENV: staging
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 1
29+
- uses: actions/setup-node@v4
30+
with:
31+
node-version: 18
32+
cache: "npm"
33+
cache-dependency-path: "**/package-lock.json"
34+
35+
- name: Render Datasheets
36+
run: cd ${GITHUB_WORKSPACE}/scripts/datasheet-rendering;./render-datasheets.sh
37+
38+
- name: Copy Static Files
39+
run: |
40+
mkdir -p static/resources/datasheets static/resources/schematics static/resources/pinouts static/resources/models
41+
find ./content/hardware -type f -name "*-schematics.pdf" -exec cp {} ./static/resources/schematics/ \;
42+
find ./content/hardware -type f -name "*-datasheet.pdf" -exec cp {} ./static/resources/datasheets/ \;
43+
find ./content/hardware -type f -name "*-full-pinout.pdf" -exec cp {} ./static/resources/pinouts/ \;
44+
find ./content/hardware -type f -name "*-pinout.png" -exec cp {} ./static/resources/pinouts/ \;
45+
find ./content/hardware -type f -name "*-step.zip" -exec cp {} ./static/resources/models/ \;
46+
47+
- name: Gatsby main cache
48+
uses: actions/cache@v4
49+
id: gatsby-cache-folder
50+
with:
51+
path: .cache
52+
key: ${{ runner.os }}-cache-gatsby-${{ github.ref_name }}
53+
restore-keys: |
54+
${{ runner.os }}-cache-gatsby-main
55+
56+
- name: Gatsby Public Folder
57+
uses: actions/cache@v4
58+
id: gatsby-public-folder
59+
with:
60+
path: public/
61+
key: ${{ runner.os }}-public-gatsby-${{ github.ref_name }}
62+
restore-keys: |
63+
${{ runner.os }}-public-gatsby-main
64+
65+
- run: npm install
66+
- run: npm run build
67+
68+
- name: Clean up node_modules
69+
run: rm -rf node_modules
70+
71+
- name: Configure AWS credentials from Staging account
72+
uses: aws-actions/configure-aws-credentials@v4
73+
with:
74+
role-to-assume: ${{ secrets.STAGING_IAM_ROLE }}
75+
aws-region: us-east-1
76+
77+
# - name: Sync all cacheable assets
78+
# run: aws s3 sync --cache-control "public, max-age=31536000, immutable" --include "*.css" --include="*.js" --include="*.gif" --include="*.png" --include="*.svg" --exclude "*.html" --exclude="sw.js" --exclude="*.json" --exclude="*.pdf" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/
79+
80+
# - name: Sync all non-cacheable assets
81+
# # Don't cache any HTML or JSON file: they should always be up-to-dates
82+
# run: aws s3 sync --cache-control "public, max-age=0, must-revalidate" --include "*.html" --include="sw.js" --include="*.json" --include "*.css" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --exclude="*.pdf" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/
83+
84+
# - name: Sync PDF
85+
# run: aws s3 sync --cache-control "public, max-age=86400, must-revalidate" --include "*.pdf" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --exclude="*.css" --exclude="*.html" --exclude="*.json" --exclude="sw.json" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/
86+
87+
# - name: Purge cache on CloudFlare
88+
# run: |
89+
# curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE }}/purge_cache" \
90+
# -H "Authorization: Bearer ${{ secrets.CLOUDFLARE_PURGE_API_TOKEN }}" \
91+
# -H "Content-Type: application/json" \
92+
# --data '{"prefixes":["${{ vars.DATASHEETS_BASE_URL }}"]}'
93+
94+
- name: Sync all cacheable assets
95+
run: aws s3 sync --cache-control "public, max-age=31536000, immutable" --include "*.css" --include="*.js" --include="*.gif" --include="*.png" --include="*.svg" --exclude "*.html" --exclude="sw.js" --exclude="*.json" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/
96+
97+
- name: Sync all non-cacheable assets
98+
# Don't cache any HTML or JSON file: they should always be up-to-dates
99+
run: aws s3 sync --cache-control "public, max-age=0, must-revalidate" --include "*.html" --include="sw.js" --include="*.json" --include "*.css" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/
100+

.github/workflows/deploy-stg.yml

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)