From 0d9d80c230ad6c8b832b55a74c13b89bf76d98e5 Mon Sep 17 00:00:00 2001 From: Azure Static Web Apps Date: Sat, 23 Jan 2021 23:35:05 -0500 Subject: [PATCH 1/6] ci: add Azure Static Web Apps workflow file on-behalf-of: @Azure opensource@microsoft.com --- ...-static-web-apps-green-grass-0dedfff10.yml | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/azure-static-web-apps-green-grass-0dedfff10.yml diff --git a/.github/workflows/azure-static-web-apps-green-grass-0dedfff10.yml b/.github/workflows/azure-static-web-apps-green-grass-0dedfff10.yml new file mode 100644 index 0000000000000..1e1909e8a4c1f --- /dev/null +++ b/.github/workflows/azure-static-web-apps-green-grass-0dedfff10.yml @@ -0,0 +1,45 @@ +name: Azure Static Web Apps CI/CD + +on: + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened, closed] + branches: + - master + +jobs: + build_and_deploy_job: + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') + runs-on: ubuntu-latest + name: Build and Deploy Job + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Build And Deploy + id: builddeploy + uses: Azure/static-web-apps-deploy@v0.0.1-preview + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GREEN_GRASS_0DEDFFF10 }} + repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) + action: "upload" + ###### Repository/Build Configurations - These values can be configured to match you app requirements. ###### + # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig + app_location: "/" # App source code path + api_location: "api" # Api source code path - optional + output_location: "" # Built app content directory - optional + ###### End of Repository/Build Configurations ###### + + close_pull_request_job: + if: github.event_name == 'pull_request' && github.event.action == 'closed' + runs-on: ubuntu-latest + name: Close Pull Request Job + steps: + - name: Close Pull Request + id: closepullrequest + uses: Azure/static-web-apps-deploy@v0.0.1-preview + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GREEN_GRASS_0DEDFFF10 }} + action: "close" From fcd2269fdf4370b281c9599ecda766f146070095 Mon Sep 17 00:00:00 2001 From: Aidan Feldman Date: Mon, 25 Jan 2021 00:42:41 -0500 Subject: [PATCH 2/6] CI: create Azure storage account with Terraform --- ci/terraform/.gitignore | 35 +++++++++++++++++++++ ci/terraform/.terraform.lock.hcl | 53 ++++++++++++++++++++++++++++++++ ci/terraform/main.tf | 20 ++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 ci/terraform/.gitignore create mode 100644 ci/terraform/.terraform.lock.hcl create mode 100644 ci/terraform/main.tf diff --git a/ci/terraform/.gitignore b/ci/terraform/.gitignore new file mode 100644 index 0000000000000..246d4334abef6 --- /dev/null +++ b/ci/terraform/.gitignore @@ -0,0 +1,35 @@ +# https://github.com/github/gitignore/blob/master/Terraform.gitignore + +**/.terraform/* + +# .tfstate files +*.tfstate +*.tfstate.* + +# Crash log files +crash.log + +# Exclude all .tfvars files, which are likely to contain sentitive data, such as +# password, private keys, and other secrets. These should not be part of version +# control as they are data points which are potentially sensitive and subject +# to change depending on the environment. +# +*.tfvars + +# Ignore override files as they are usually used to override resources locally and so +# are not checked in +override.tf +override.tf.json +*_override.tf +*_override.tf.json + +# Include override files you do wish to add to version control using negated pattern +# +# !example_override.tf + +# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan +# example: *tfplan* + +# Ignore CLI configuration files +.terraformrc +terraform.rc diff --git a/ci/terraform/.terraform.lock.hcl b/ci/terraform/.terraform.lock.hcl new file mode 100644 index 0000000000000..954defcf9fa80 --- /dev/null +++ b/ci/terraform/.terraform.lock.hcl @@ -0,0 +1,53 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/azurerm" { + version = "2.27.0" + hashes = [ + "h1:s7/Mbrdgh9jYXYlRyT8To4upkstnrB5XQjRh+Impnak=", + "zh:1c1097257da7dbefc29560d9998fd3ba53a119062c17e2ffc9391664681990e3", + "zh:3237b15f64a737d58aa4a36390faf50c0c909bb09329078c8d08d17d75f42e98", + "zh:3b86d58572216e187ee03129039b58b59ce91c53ef331f63fd459067f749608e", + "zh:571785e9dccfe3de550f9bfa21f11e5cdfff4a13bfc682d922f2a9f54bd44f95", + "zh:65e452ebc3c56ba93953a57dc21f34b4ccb23ceea2130b4ce7730c98d7ed9818", + "zh:6c5b7139d5b5f471d754b9a7e5e2b08249f0f636015e7cfc9a4c40d092fc985e", + "zh:bf4b945ead17f9b5bdcbd96154846d8b85909b131aaaee2f97c64a8bc6aaa766", + "zh:cb2203fec73b215637de3f9b4e0ca62544a51883a666c5e5a24e12b3d33cc215", + "zh:e8edbc12ec27571f31c27b7b60b267b3fc41e982ea626ecefe8f5271a848367a", + "zh:ed1b1f850755b6aa737e4c0c069db75e030b120ee02fcd486cbd478c9499c62b", + ] +} + +provider "registry.terraform.io/hashicorp/null" { + version = "3.0.0" + hashes = [ + "h1:V1tzrSG6t3e7zWvUwRbGbhsWU2Jd/anrJpOl9XM+R/8=", + "zh:05fb7eab469324c97e9b73a61d2ece6f91de4e9b493e573bfeda0f2077bc3a4c", + "zh:1688aa91885a395c4ae67636d411475d0b831e422e005dcf02eedacaafac3bb4", + "zh:24a0b1292e3a474f57c483a7a4512d797e041bc9c2fbaac42fe12e86a7fb5a3c", + "zh:2fc951bd0d1b9b23427acc93be09b6909d72871e464088171da60fbee4fdde03", + "zh:6db825759425599a326385a68acc6be2d9ba0d7d6ef587191d0cdc6daef9ac63", + "zh:85985763d02618993c32c294072cc6ec51f1692b803cb506fcfedca9d40eaec9", + "zh:a53186599c57058be1509f904da512342cfdc5d808efdaf02dec15f0f3cb039a", + "zh:c2e07b49b6efa676bdc7b00c06333ea1792a983a5720f9e2233db27323d2707c", + "zh:cdc8fe1096103cf5374751e2e8408ec4abd2eb67d5a1c5151fe2c7ecfd525bef", + "zh:dbdef21df0c012b0d08776f3d4f34eb0f2f229adfde07ff252a119e52c0f65b7", + ] +} + +provider "registry.terraform.io/hashicorp/random" { + version = "3.0.1" + hashes = [ + "h1:0QaSbRBgBi8vI/8IRwec1INdOqBxXbgsSFElx1O4k4g=", + "zh:0d4f683868324af056a9eb2b06306feef7c202c88dbbe6a4ad7517146a22fb50", + "zh:4824b3c7914b77d41dfe90f6f333c7ac9860afb83e2a344d91fbe46e5dfbec26", + "zh:4b82e43712f3cf0d0cbc95b2cbcd409ba8f0dc7848fdfb7c13633c27468ed04a", + "zh:78b3a2b860c3ebc973a794000015f5946eb59b82705d701d487475406b2612f1", + "zh:88bc65197bd74ff408d147b32f0045372ae3a3f2a2fdd7f734f315d988c0e4a2", + "zh:91bd3c9f625f177f3a5d641a64e54d4b4540cb071070ecda060a8261fb6eb2ef", + "zh:a6818842b28d800f784e0c93284ff602b0c4022f407e4750da03f50b853a9a2c", + "zh:c4a1a2b52abd05687e6cfded4a789dcd7b43e7a746e4d02dd1055370cf9a994d", + "zh:cf65041bf12fc3bde709c1d267dbe94142bc05adcabc4feb17da3b12249132ac", + "zh:e385e00e7425dda9d30b74ab4ffa4636f4b8eb23918c0b763f0ffab84ece0c5c", + ] +} diff --git a/ci/terraform/main.tf b/ci/terraform/main.tf new file mode 100644 index 0000000000000..13a267f4f1dde --- /dev/null +++ b/ci/terraform/main.tf @@ -0,0 +1,20 @@ +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "site" { + name = "pandas-site" + location = "Central US" +} + +resource "azurerm_storage_account" "storeacc" { + name = "pandaspr" + resource_group_name = azurerm_resource_group.site.name + location = azurerm_resource_group.site.location + account_tier = "Standard" + account_replication_type = "ZRS" + + static_website { + index_document = "index.html" + } +} From 0221765f2f6e683e917a60706826401aebb1aa6c Mon Sep 17 00:00:00 2001 From: Aidan Feldman Date: Mon, 25 Jan 2021 01:07:37 -0500 Subject: [PATCH 3/6] CI: save site+docs builds as artifacts --- .github/workflows/ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b551e7ded0178..3fff3267fc2c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -118,6 +118,17 @@ jobs: source activate pandas-dev doc/make.py --warnings-are-errors | tee sphinx.log ; exit ${PIPESTATUS[0]} + - name: Save website as an artifact + uses: actions/upload-artifact@v2 + with: + name: website + path: web/build + - name: Save docs as an artifact + uses: actions/upload-artifact@v2 + with: + name: docs + path: doc/build/html + # This can be removed when the ipython directive fails when there are errors, # including the `tee sphinx.log` in te previous step (https://github.com/ipython/ipython/issues/11547) - name: Check ipython directive errors From 9dc7310708cbb93b54dbae078248e4474c09c6a8 Mon Sep 17 00:00:00 2001 From: Aidan Feldman Date: Mon, 25 Jan 2021 01:37:43 -0500 Subject: [PATCH 4/6] output container URL --- ci/terraform/main.tf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci/terraform/main.tf b/ci/terraform/main.tf index 13a267f4f1dde..aa96b6563a2b2 100644 --- a/ci/terraform/main.tf +++ b/ci/terraform/main.tf @@ -18,3 +18,7 @@ resource "azurerm_storage_account" "storeacc" { index_document = "index.html" } } + +output "container" { + value = azurerm_storage_account.storeacc.primary_web_host +} From 1147015e0c3d0a8932fc88b6270a516a993a3062 Mon Sep 17 00:00:00 2001 From: Aidan Feldman Date: Mon, 25 Jan 2021 01:43:55 -0500 Subject: [PATCH 5/6] remove warnings as errors --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3fff3267fc2c9..18e3a55510252 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -116,7 +116,7 @@ jobs: - name: Build documentation run: | source activate pandas-dev - doc/make.py --warnings-are-errors | tee sphinx.log ; exit ${PIPESTATUS[0]} + doc/make.py | tee sphinx.log ; exit ${PIPESTATUS[0]} - name: Save website as an artifact uses: actions/upload-artifact@v2 From 2016f8ac2ff2357585c3f8c78739db2d8a26541c Mon Sep 17 00:00:00 2001 From: Aidan Feldman Date: Mon, 25 Jan 2021 03:49:16 -0500 Subject: [PATCH 6/6] CI: automatically purge old content --- ci/terraform/main.tf | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ci/terraform/main.tf b/ci/terraform/main.tf index aa96b6563a2b2..ddc848821ae21 100644 --- a/ci/terraform/main.tf +++ b/ci/terraform/main.tf @@ -19,6 +19,27 @@ resource "azurerm_storage_account" "storeacc" { } } +resource "azurerm_storage_management_policy" "prs" { + storage_account_id = azurerm_storage_account.storeacc.id + + # automatically purge old content + # https://docs.microsoft.com/en-us/azure/storage/blobs/storage-lifecycle-management-concepts?tabs=azure-portal#expire-data-based-on-age + rule { + name = "expirationRule" + enabled = true + + filters { + blob_types = ["blockBlob"] + } + + actions { + base_blob { + delete_after_days_since_modification_greater_than = 14 + } + } + } +} + output "container" { value = azurerm_storage_account.storeacc.primary_web_host }