Skip to content

Commit

Permalink
Multi-Stage Deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
gwon188 committed Jul 29, 2022
1 parent f39dfe2 commit 3ed71ed
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 31 deletions.
60 changes: 33 additions & 27 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,47 @@ on:
title:
type: string
required: true
description: Enter the release title
description: 'Enter the release title'
artifact_name:
type: string
required: false
description: Name of artifact
description: 'Name of artifact'
default: apiapp
env:
type: string
required: false
description: 'Environment name'
default: DEV

jobs:
release:
name: Release Apps
name: 'Release Apps'

runs-on: ubuntu-latest

environment: ${{ inputs.env }}

steps:
- name: Download FunctionApp artifact
uses: actions/download-artifact@v2
with:
name: ${{ inputs.artifact_name }}
path: artifacts/api

- name: Zip FunctionApp artifact
shell: bash
run: |
pushd artifacts/api
zip -qq -r ${{ inputs.artifact_name }}.zip .
popd
mv artifacts/api/${{ inputs.artifact_name }}.zip artifacts/${{ inputs.artifact_name }}.zip
- name: Release FunctionApp artifact to GitHub
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
title: ${{ inputs.title }}
files: |
artifacts/${{ inputs.artifact_name }}.zip
- name: 'Download FunctionApp artifact'
uses: actions/download-artifact@v2
with:
name: ${{ inputs.artifact_name }}
path: artifacts/api

- name: 'Zip FunctionApp artifact'
shell: bash
run: |
pushd artifacts/api
zip -qq -r ${{ inputs.artifact_name }}-${{ inputs.env }}.zip .
popd
mv artifacts/api/${{ inputs.artifact_name }}-${{ inputs.env }}.zip artifacts/${{ inputs.artifact_name }}-${{ inputs.env }}.zip
- name: 'Release FunctionApp artifact to GitHub'
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
title: ${{ inputs.title }}
files: |
artifacts/${{ inputs.artifact_name }}-${{ inputs.env }}.zip
18 changes: 14 additions & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,24 @@ on:

jobs:
call_build:
uses: ./.github/workflows/ci.yaml
uses: './.github/workflows/ci.yaml'
with:
artifact_name: apiapp

call_release:
uses: ./.github/workflows/cd.yaml
call_release_dev:
uses: './.github/workflows/cd.yaml'
needs: call_build
with:
title: latest
artifact_name: apiapp
env: DEV
secrets: inherit

call_release_prod:
uses: './.github/workflows/cd.yaml'
needs: call_release_dev
with:
title: latest
artifact_name: apiapp
env: PROD
secrets: inherit

0 comments on commit 3ed71ed

Please sign in to comment.