Home

Awesome

GitHub Action to Upload to Azure Storage

⚠️ Note: To use this action, you must have access to the GitHub Actions feature.

This action is designed to use the Azure CLI to enable static website and upload a directory of your choice to your Azure Storage account.

Usage

Example

Place in a .yml file such as this one in your .github/workflows folder. Refer to the documentation on workflow YAML syntax here.

name: Upload To Azure
on: push

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - uses: feeloor/azure-static-website-deploy@master
        env:
          SOURCE_DIR: "./public"
          AZURE_CLIENT_ID: "<azure-client-id>"
          AZURE_TENANT_ID: "<azure-tenant-id>"
          AZURE_SECRET: "<azure-secret>"
          AZURE_SUBSCRIPTION_ID: "<azure-subscription-id>"
          AZURE_STORAGE_ACCOUNT_NAME: "<azure-storage-account-name>"
          AZURE_INDEX_DOCUMENT_NAME: "<index-document-name>"
          AZURE_ERROR_DOCUMENT_NAME: "<error-document-name>"
          FORCE_OVERWRITE: "true"

Required Variables

KeyValueTypeRequired
SOURCE_DIRThe name of the directory you want to uploadenvYes
AZURE_CLIENT_IDYour Azure Client ID.secretYes
AZURE_SECRETYour Azure Secret.secretYes
AZURE_TENANT_IDYour Azure Tenant ID.secretYes
AZURE_SUBSCRIPTION_IDYour Azure Subscription ID.secretYes
AZURE_STORAGE_ACCOUNT_NAMEYour Azure Storage Account Name.secretYes
AZURE_INDEX_DOCUMENT_NAMEThe index document that you specify when you enable static website hosting, appears when users open the site and don't specify a specific file. More Information HereenvYes
AZURE_ERROR_DOCUMENT_NAMEIf the server returns a 404 error, and you have not specified an error document when you enabled the website, then a default 404 page is returned to the user. More Information HeresecretNo
FORCE_OVERWRITEIf the uploaded file already exists, by default the AZ CLI (since March 2022) will not uploads the file. It is possible to force the upload. More Information HereenvNo

License

This project is distributed under the MIT license.