diff --git a/.github/workflows/deploy-prd.yml b/.github/workflows/deploy-prd.yml deleted file mode 100644 index aa6d60de59..0000000000 --- a/.github/workflows/deploy-prd.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: Deploy to production - -on: - workflow_dispatch: - push: - branches: - - main - -concurrency: - group: deploy-prd - cancel-in-progress: true - -jobs: - build: - if: "github.repository == 'arduino/docs-content'" - runs-on: ubuntu-latest - env: - REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }} - APP_ENV: prod - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-node@v4 - with: - node-version: 18 - 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 static/resources/models - 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 - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }} - aws-region: us-west-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.PROD_AWS_S3_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.PROD_AWS_S3_BUCKET_NAME }}/ diff --git a/.github/workflows/deploy-stg.yml b/.github/workflows/deploy-stg.yml deleted file mode 100644 index de9d3de5b6..0000000000 --- a/.github/workflows/deploy-stg.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: Deploy to docs.oniudra.cc - -on: - workflow_dispatch: - push: - branches: - - ghaction - -concurrency: - group: deploy-stg - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-latest - env: - REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }} - APP_ENV: staging - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - run: git log -1 --pretty=format:%aI content/learn/04.electronics/05.servo-motors/servo-motors.md - - uses: actions/setup-node@v4 - with: - node-version: 18 - 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 static/resources/models - 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 - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.STAG_AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.STAG_AWS_SECRET_ACCESS_KEY }} - aws-region: us-west-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.STAG_AWS_S3_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.STAG_AWS_S3_BUCKET_NAME }}/