You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Azure Static Website
v1
This action was inspired by Azure Storage Action
. I re-wrote the whole thing using node.js
With Azure Static Website Action
, you can automate your workflow to deploy files to Azure Blob Storage
- Checkout Checkout your Git repository content into Github Actions agent.
- Follow the tutorial Azure Storage Account)
- Copy the following example of workflow and create the workflow to
.github/workflows/
in your project repository. - Change
folder
to your folder path where files to deploy are. - Commit and push your project to GitHub repository, you should see a new GitHub Action initiated in Actions tab.
# File: .github/workflows/workflow.yml
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: tibor19/static-website-deploy@v1
with:
enabled-static-website: 'true'
folder: 'MyFolder'
connection-string: ${{ secrets.CONNECTION_STRING }}
For any credentials like Azure Service Principal, Publish Profile, Connection Strings, etc add them as secrets in the GitHub repository and then use them in the workflow.
The above example uses the Connection String of your Azure Storage Account.
Follow the steps to configure the secret:
- Follow the tutorial View and copy a connection string and copy the connection string.
- Define a new secret under your repository settings, Add secret menu.
- Paste the connection string file into the secret's value field.
- Now in the workflow file in your branch:
.github/workflows/workflow.yml
replace the secret for the inputconnection-string:
of the Azure Storage Action (Refer to the example above).