From 1fa48af6f555f964bc2c1986a4f1eaf5f986d0ca Mon Sep 17 00:00:00 2001 From: Massimo Schenone <1193386+mschenone@users.noreply.github.com> Date: Fri, 7 Jun 2024 10:37:23 +0200 Subject: [PATCH] fixup! Deploy to docs-content --- .github/workflows/deploy-staging.yml | 76 ++++++++++++++-------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index 910336e215..8168a58610 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -34,38 +34,38 @@ jobs: cache: "npm" cache-dependency-path: "**/package-lock.json" -# - name: Render Datasheets -# run: cd ${GITHUB_WORKSPACE}/scripts/datasheet-rendering;./render-datasheets.sh -# -# - name: Copy Static Files -# run: | -# mkdir -p static/resources/datasheets static/resources/schematics static/resources/pinouts -# find ./content/hardware -type f -name "*-schematics.pdf" -exec cp {} ./static/resources/schematics/ \; -# find ./content/hardware -type f -name "*-datasheet.pdf" -exec cp {} ./static/resources/datasheets/ \; -# find ./content/hardware -type f -name "*-full-pinout.pdf" -exec cp {} ./static/resources/pinouts/ \; -# find ./content/hardware -type f -name "*-pinout.png" -exec cp {} ./static/resources/pinouts/ \; -# find ./content/hardware -type f -name "*-step.zip" -exec cp {} ./static/resources/models/ \; -# -# - name: Gatsby main cache -# uses: actions/cache@v4 -# id: gatsby-cache-folder -# with: -# path: .cache -# key: ${{ runner.os }}-cache-gatsby-${{ github.sha }} -# restore-keys: | -# ${{ runner.os }}-cache-gatsby- -# -# - name: Gatsby Public Folder -# uses: actions/cache@v4 -# id: gatsby-public-folder -# with: -# path: public/ -# key: ${{ runner.os }}-public-gatsby-${{ github.sha }} -# restore-keys: | -# ${{ runner.os }}-public-gatsby- -# -# - run: npm install -# - run: npm run build + - name: Render Datasheets + run: cd ${GITHUB_WORKSPACE}/scripts/datasheet-rendering;./render-datasheets.sh + + - name: Copy Static Files + run: | + mkdir -p static/resources/datasheets static/resources/schematics static/resources/pinouts + find ./content/hardware -type f -name "*-schematics.pdf" -exec cp {} ./static/resources/schematics/ \; + find ./content/hardware -type f -name "*-datasheet.pdf" -exec cp {} ./static/resources/datasheets/ \; + find ./content/hardware -type f -name "*-full-pinout.pdf" -exec cp {} ./static/resources/pinouts/ \; + find ./content/hardware -type f -name "*-pinout.png" -exec cp {} ./static/resources/pinouts/ \; + find ./content/hardware -type f -name "*-step.zip" -exec cp {} ./static/resources/models/ \; + + - name: Gatsby main cache + uses: actions/cache@v4 + id: gatsby-cache-folder + with: + path: .cache + key: ${{ runner.os }}-cache-gatsby-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-cache-gatsby- + + - name: Gatsby Public Folder + uses: actions/cache@v4 + id: gatsby-public-folder + with: + path: public/ + key: ${{ runner.os }}-public-gatsby-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-public-gatsby- + + - run: npm install + - run: npm run build - name: Configure AWS credentials from Staging account uses: aws-actions/configure-aws-credentials@v4 @@ -73,9 +73,9 @@ jobs: role-to-assume: ${{ secrets.STAGING_IAM_ROLE }} aws-region: us-east-1 -# - name: Sync all cacheable assets -# 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 }}/ -# -# - name: Sync all non-cacheable assets -# # Don't cache any HTML or JSON file: they should always be up-to-dates -# 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 }}/ + - name: Sync all cacheable assets + 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 }}/ + + - name: Sync all non-cacheable assets + # Don't cache any HTML or JSON file: they should always be up-to-dates + 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 }}/