From db5019ee9d183bb195b3d5df068d85efc30ae679 Mon Sep 17 00:00:00 2001 From: leoecrepont Date: Wed, 28 Aug 2024 15:42:07 +0200 Subject: [PATCH] chore(ci): add a continuous deployment workflow Fixes MRGFY-3971 --- .github/workflows/continuous_deployment.yml | 40 +++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/continuous_deployment.yml diff --git a/.github/workflows/continuous_deployment.yml b/.github/workflows/continuous_deployment.yml new file mode 100644 index 0000000..2b24170 --- /dev/null +++ b/.github/workflows/continuous_deployment.yml @@ -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/checkout@v4.1.7 + + # CircleCI only let us promote with patch, minor or major command argument + # Uses a tag in the following format: - + - 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 -" + 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 }}