Skip to content

feeloor/azure-static-website-deploy

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Key Value Type Required
SOURCE_DIR The name of the directory you want to upload env Yes
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
FORCE_OVERWRITE If 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 Here env No

License

This project is distributed under the MIT license.