⚠️ 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.
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"
FILE_PATTERN: "*.html"
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>"
CDN_PROFILE: "<Content delivery network profile to purge>"
RESOURCE_GROUP: "<resource group that the CDN belongs to>"
CDN_ENDPOINT: "<cdn endpoint that the cdn profile belongs to>"
Key | Value | Type | Required |
---|---|---|---|
SOURCE_DIR |
The name of the directory you want to upload | env |
Yes |
FILE_PATTERN |
The pattern used for globbing files or blobs in the source. The supported patterns are '*', '?', '[seq]', and '[!seq]'. | env |
No |
AZURE_CLIENT_ID |
Your Azure Client ID. | secret |
Yes |
AZURE_SECRET |
Your Azure Secret. | secret |
Yes |
AZURE_TENANT_ID |
Your Azure Tenant ID. | secret |
Yes |
AZURE_SUBSCRIPTION_ID |
Your Azure Subscription ID. | secret |
Yes |
AZURE_STORAGE_ACCOUNT_NAME |
Your Azure Storage Account Name. | secret |
Yes |
AZURE_INDEX_DOCUMENT_NAME |
The 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 Here | env |
Yes |
AZURE_ERROR_DOCUMENT_NAME |
If 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 Here | secret |
No |
CDN_PROFILE |
Name of the Content Delivery Network to purge after deployment | env |
No |
CDN_ENDPOINT |
CDN Endpoint that the CDN Profile belongs to | env |
No |
RESOURCE_GROUP |
Resource group that the CDN Profile belongs to | env |
No |
This project is distributed under the MIT license.