Deploy selected release to staging environment on demand #1
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: Deploy selected release to staging environment on demand | |
on: | |
workflow_dispatch: | |
inputs: | |
release_tag: | |
description: "Release tag to deploy" | |
required: true | |
default: "latest" | |
jobs: | |
deploy-release-to-staging: | |
runs-on: ubuntu-latest | |
environment: | |
name: STAGING_ENVIRONMENT | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
name: Checkout repository | |
- name: Download zip from release | |
run: gh release download ${{ github.event.inputs.release_tag }} -p ${{ github.event.repository.name }}-${{ github.event.inputs.release_tag }}-staging.zip | |
- name: Unzip artifact | |
run: unzip ${{ github.event.repository.name }}-${{ github.event.inputs.release_tag }}-staging.zip | |
- name: Show the content of the artifact | |
run: ls -la dist | |
- name: Deploy to staging | |
run: echo "Deploying ${{ github.event.repository.name }}-${{ github.event.inputs.release_tag }}-staging to staging environment" | |
- name: Upload dist folder to azure storage account | |
uses: bacongobbler/azure-blob-storage-upload@main | |
with: | |
connection_string: ${{ secrets.AZURE_STORAGE_ACCOUNT_CONNECTION_STRING }} | |
container_name: $web | |
source_dir: dist | |
overwrite: "true" |