-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): add a deployment workflow (#11)
Fixes MRGFY-3971 Adds a Workflow that triggers on GH release to publish a new increment of the Orb to production.
- Loading branch information
1 parent
6644b65
commit 333374a
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Deploy Orb | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
release: | ||
timeout-minutes: 5 | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/[email protected] | ||
|
||
# CircleCI only let us promote with patch, minor or major command argument | ||
# Uses a tag in the following format: <semver>-<patch|minor|major> | ||
- name: Get CircleCI Increment from tag | ||
id: circleci_increment | ||
run: | | ||
if [[ ${{ github.ref_name }} =~ [0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}\-(patch|minor|major) ]]; then | ||
echo "CIRCLECI_INCREMENT_ARG=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "Invalid tag: ${{ github.ref_name }}, expected <semver>-<patch|minor|major>" | ||
exit 1 | ||
fi | ||
- name: Install CircleCI CLI | ||
run: | | ||
curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/main/install.sh | bash | ||
- name: Publish Orb version | ||
run: | | ||
circleci orb pack src > orb.yml | ||
circleci orb validate orb.yml | ||
circleci orb publish orb.yml mergifyio/ci-issues@dev:test_version \ | ||
--token ${{ secrets.CIRCLECI_API_TOKEN }} | ||
circleci orb publish promote mergifyio/ci-issues@dev:test_version \ | ||
${{ steps.circleci_increment.outputs.CIRCLECI_INCREMENT_ARG }} \ | ||
--token ${{ secrets.CIRCLECI_API_TOKEN }} |