From 7c9065ef55487a579bd6e0392ecf4b5dd402e3fe Mon Sep 17 00:00:00 2001 From: Brock Fanning Date: Thu, 20 Jul 2023 06:50:08 -0400 Subject: [PATCH 1/2] Use Github Actions for place robots.txt files --- .github/workflows/deploy-to-production.yml | 3 +++ .github/workflows/deploy-to-staging.yml | 3 +++ public/robots-prod.txt | 2 ++ public/robots-staging.txt | 2 ++ 4 files changed, 10 insertions(+) create mode 100644 public/robots-prod.txt create mode 100644 public/robots-staging.txt diff --git a/.github/workflows/deploy-to-production.yml b/.github/workflows/deploy-to-production.yml index 246331066e0..df893816e1c 100644 --- a/.github/workflows/deploy-to-production.yml +++ b/.github/workflows/deploy-to-production.yml @@ -47,6 +47,9 @@ jobs: - name: Build data run: | python scripts/build_data.py + - name: Place public files + run: | + cp public/robots-prod.txt _site/robots.txt - name: Deploy to GitHub Pages uses: JamesIves/github-pages-deploy-action@3.7.1 with: diff --git a/.github/workflows/deploy-to-staging.yml b/.github/workflows/deploy-to-staging.yml index c22636fad77..4ea56292ccb 100644 --- a/.github/workflows/deploy-to-staging.yml +++ b/.github/workflows/deploy-to-staging.yml @@ -41,6 +41,9 @@ jobs: - name: Build data run: | python scripts/build_data.py + - name: Place public files + run: | + cp public/robots-staging.txt _site/robots.txt - name: Deploy to GitHub Pages uses: JamesIves/github-pages-deploy-action@3.7.1 with: diff --git a/public/robots-prod.txt b/public/robots-prod.txt new file mode 100644 index 00000000000..1f53798bb4f --- /dev/null +++ b/public/robots-prod.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / diff --git a/public/robots-staging.txt b/public/robots-staging.txt new file mode 100644 index 00000000000..1f53798bb4f --- /dev/null +++ b/public/robots-staging.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / From bc0be701e367dba4a418c2de4b6a3573933c3f14 Mon Sep 17 00:00:00 2001 From: Brock Fanning Date: Thu, 20 Jul 2023 06:54:13 -0400 Subject: [PATCH 2/2] Also robots.txt for feature branches --- .github/workflows/deploy-feature-branch.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy-feature-branch.yml b/.github/workflows/deploy-feature-branch.yml index 5d18eb3d987..261f2e7a755 100644 --- a/.github/workflows/deploy-feature-branch.yml +++ b/.github/workflows/deploy-feature-branch.yml @@ -34,6 +34,9 @@ jobs: - name: Build data run: | python scripts/build_data.py + - name: Place public files + run: | + cp public/robots-staging.txt _site/robots.txt - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v3.x - name: Push data build to S3