Skip to content

Instantly share code, notes, and snippets.

@lynshi
Last active December 29, 2019 17:48
Show Gist options
  • Save lynshi/cbb0c0e937995c4ea4560d4a2313bfc7 to your computer and use it in GitHub Desktop.
Save lynshi/cbb0c0e937995c4ea4560d4a2313bfc7 to your computer and use it in GitHub Desktop.
GitHub Actions script for deploying static website to Azure.
name: Deploy to Azure
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
npm install
npm install -g gatsby-cli
- name: Build with Gatsby
run: gatsby build
- name: Azure upload
uses: azure/CLI@v1
with:
azcliversion: 2.0.72
inlineScript: |
az storage blob delete-batch -s "\$web" --connection-string "${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}"
az storage blob upload-batch -d "\$web" -s public --connection-string "${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment