Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Building CI/CD Pipelines with GitHub Actions
- name: Download app
uses: actions/download-artifact@v1
with:
name: app
path: src/WebApp/dist
- name: Upload app
uses: actions/upload-artifact@v1
with:
name: app
path: src/WebApp/dist
...
jobs:
build_and_publish:
runs-on: ubuntu-latest
...
deploy_to_dev:
needs: build_and_publish
runs-on: ubuntu-latest
...
deploy_to_test:
needs: deploy_to_dev
runs-on: ubuntu-latest
...
deploy_to_prod:
needs: deploy_to_test
runs-on: ubuntu-latest
...
...
jobs:
build_and_publish:
runs-on: ubuntu-latest
...
deploy_to_dev:
needs: build_and_publish
runs-on: ubuntu-latest
...
deploy_to_test:
needs: build_and_publish
runs-on: ubuntu-latest
...
deploy_to_prod:
needs: build_and_publish
runs-on: ubuntu-latest
...
deploy_to_dev:
needs: build_and_publish
runs-on: ubuntu-latest
steps:
- name: Download app
uses: actions/download-artifact@v1
with:
name: app
path: src/WebApp/dist
- name: Login to Azure
uses: Azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Publish app
uses: Azure/cli@v1.0.0
with:
azcliversion: latest
inlineScript: |
az storage blob upload-batch -s $GITHUB_WORKSPACE/src/WebApp/dist -d \$web --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }}
deploy_to_prod:
needs: deploy_to_dev
runs-on: ubuntu-latest
steps:
- name: Download app
uses: actions/download-artifact@v1
with:
name: app
path: src/WebApp/dist
- name: Login to Azure
uses: Azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Publish app
uses: Azure/cli@v1.0.0
with:
azcliversion: latest
inlineScript: |
az storage blob upload-batch -s $GITHUB_WORKSPACE/src/WebApp/dist -d \$web --account-name ${{ secrets.STORAGE_ACCOUNT_NAME_2 }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.