Azure Storage Action
v1.0
透過Azure Storage Action
,您可以自動化工作流程以將檔案部署到 Azure Blob 儲存
.github/workflows/
中。folder
變更為要部署的檔案所在的資料夾路徑。 # File: .github/workflows/workflow.yml
on : [push]
jobs :
build :
runs-on : ubuntu-latest
steps :
- uses : actions/checkout@v1
- uses : actions/setup-dotnet@v1
with :
dotnet-version : ' 3.0.100 '
- uses : lauchacarro/Azure-Storage-Action@master
with :
enabled-static-website : ' true '
folder : ' MyFolder '
index-document : ' index.html '
error-document : ' 404.html ' # For Angular apps with routing enabled, this must point to the index.html file because the requested routes don't exist phyiscally and blob storage would throw a 404.
connection-string : ${{ secrets.CONNECTION_STRING }}
對於任何憑證(例如 Azure 服務主體、發布設定檔、連接字串等),將它們作為機密新增至 GitHub 儲存庫中,然後在工作流程中使用它們。
上面的範例使用 Azure 儲存帳戶的連接字串。
請依照以下步驟配置機密:
.github/workflows/workflow.yml
取代 Azure 儲存作業的輸入connection-string:
的金鑰(請參閱上面的範例)。