Skip to content

Commit

Permalink
ci: Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko committed Feb 3, 2023
1 parent c64df2c commit bdbdb63
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
type: string
sha:
description: 'SHA'
required: true
type: string
branch:
description: 'Branch'
type: string
default: main

jobs:
staging:
runs-on: ubuntu-latest
steps:
- name: Setup bob
uses: hashicorp/action-setup-bob@v1
with:
github-token:
${{ secrets.BOB_GITHUB_TOKEN }}
- name: Promote to staging
env:
BOB_GITHUB_TOKEN: ${{ secrets.BOB_GITHUB_TOKEN }}
VERSION: ${{ github.event.inputs.version }}
SHA: ${{ github.event.inputs.sha }}
BRANCH: main
ENVIRONMENT: staging
run: |
bob trigger-promotion \
--product-name=hc-install \
--environment=hc-install-oss \
--org=hashicorp \
--repo=hc-install \
--slack-channel=C01QDH3Q37W \
--product-version=$VERSION \
--sha=$SHA \
--branch=$BRANCH \
$ENVIRONMENT
production:
runs-on: ubuntu-latest
steps:
- name: Setup bob
uses: hashicorp/action-setup-bob@v1
with:
github-token:
${{ secrets.BOB_GITHUB_TOKEN }}
- name: Promote to production
env:
BOB_GITHUB_TOKEN: ${{ secrets.BOB_GITHUB_TOKEN }}
VERSION: ${{ github.event.inputs.version }}
SHA: ${{ github.event.inputs.sha }}
BRANCH: main
ENVIRONMENT: production
run: |
bob trigger-promotion \
--product-name=hc-install \
--environment=hc-install-oss \
--org=hashicorp \
--repo=hc-install \
--slack-channel=C01QDH3Q37W \
--product-version=$VERSION \
--sha=$SHA \
--branch=$BRANCH \
$ENVIRONMENT

0 comments on commit bdbdb63

Please sign in to comment.