From 365b95e28a22d1894aee096c2111de035fb18fdc Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Mon, 24 Jul 2023 12:09:12 -0400 Subject: [PATCH] chore: Add remote calcom/docker release workflow (#9841) Co-authored-by: Keith Williams --- .github/workflows/release-docker.yaml | 47 +++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/release-docker.yaml diff --git a/.github/workflows/release-docker.yaml b/.github/workflows/release-docker.yaml new file mode 100644 index 0000000000..5a3bde04f4 --- /dev/null +++ b/.github/workflows/release-docker.yaml @@ -0,0 +1,47 @@ +name: "Release Docker" + +on: # yamllint disable-line rule:truthy + release: + types: + - created + # in case manual trigger is needed + workflow_dispatch: + inputs: + RELEASE_TAG: + description: 'v{Major}.{Minor}.{Patch}' + +jobs: + release: + name: "Remote Release" + + runs-on: "ubuntu-latest" + + steps: + - name: checkout + uses: actions/checkout@v3 + + - name: "Determine tag" + run: "echo \"RELEASE_TAG=${GITHUB_REF#refs/tags/}\" >> $GITHUB_ENV" + + - name: "Run remote release workflow" + uses: "actions/github-script@v6" + with: + # Requires a personal access token with Actions Read and write permissions on calcom/docker. + github-token: "${{ secrets.DOCKER_REPO_ACCESS_TOKEN }}" + script: | + try { + const response = await github.rest.actions.createWorkflowDispatch({ + owner: context.repo.owner, + repo: 'docker', + workflow_id: 'create-release.yaml', + ref: 'main', + inputs: { + "RELEASE_TAG": ${{ inputs.RELEASE_TAG }} + }, + }); + + console.log(response); + } catch (error) { + console.error(error); + core.setFailed(error.message); + }