manilpit Committed code for azure blob storage #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CICD Frontend Dev | |
run-name: ${{ github.actor }} Committed code for azure blob storage | |
on: | |
push: | |
branches: | |
- dev | |
env: | |
ACCOUNT_NAME: udirdit | |
SOURCE: dist | |
DESTINATION: udirdesign-dev | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Install dependencies | |
run: yarn install | |
- name: Run build script | |
run: npm run buildDev | |
- name: Login to Azure | |
uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: Upload files to Azure Blob | |
uses: azure/CLI@v1 | |
with: | |
azcliversion: 2.48.1 | |
inlineScript: | | |
az storage blob upload-batch --account-name ${{ env.ACCOUNT_NAME }} \ | |
--auth-mode key -s ${{ env.SOURCE }} -d ${{ env.DESTINATION }} --overwrite | |
# Azure logout - Force step to always run with 'always()', ensures no hanging logins | |
- name: logout | |
if: always() | |
run: | | |
az logout |