From 4995e3f694554615fa45fdd1ea23d13c94247b9a Mon Sep 17 00:00:00 2001 From: Mathieu Veber Date: Thu, 9 Nov 2023 12:00:13 +0100 Subject: [PATCH 1/2] ci: Add sample CD workflow --- .github/workflows/continuous-delivery.yml | 37 +++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/continuous-delivery.yml diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml new file mode 100644 index 0000000..2623918 --- /dev/null +++ b/.github/workflows/continuous-delivery.yml @@ -0,0 +1,37 @@ +name: Release, Publish, Deploy + +on: + workflow_call: + inputs: + semver: + description: Semver version format expected. If set, a release will be created on Github. + required: false + type: string + type: + description: If set to "module", the code will be published to npm. If set to "service", the code will be deployed to Scalingo. + required: true + type: string + + secrets: + NPM_TOKEN: + description: Needed to publish a package to npm + required: true + SCALINGO_TOKEN: + description: Needed to deploy to Scalingo + required: true + +jobs: + build-test: + runs-on: ubuntu-latest + + steps: + - name: Release on Github + run: echo ${{ inputs.semver }} + + - name: Publish on NPM + if: inputs.type == 'module' + run: echo ${{ inputs.type }} + + - name: Deploy on Scalingo + if: inputs.type == 'service' + run: echo ${{ inputs.type }} From d74fa7e91f212ec3a902fe85521cd960bd033e3f Mon Sep 17 00:00:00 2001 From: Mathieu Veber Date: Thu, 9 Nov 2023 13:22:14 +0100 Subject: [PATCH 2/2] ci: Update assign-project so it works in this repo --- .github/workflows/assign-to-project.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/assign-to-project.yml b/.github/workflows/assign-to-project.yml index 4f6c879..3fd5429 100644 --- a/.github/workflows/assign-to-project.yml +++ b/.github/workflows/assign-to-project.yml @@ -29,14 +29,14 @@ jobs: name: Add to project uses: actions/add-to-project@v0.5.0 with: - project-url: https://github.com/orgs/hedia-team/projects/${{inputs.project-id}} + project-url: https://github.com/orgs/hedia-team/projects/${{inputs.project-id || 2}} github-token: ${{ secrets.ASSIGN_TO_PROJECT_TOKEN }} - if: github.event_name == 'pull_request' name: Set status uses: hedia-team/titoportas_update-project-fields@v0.1.0 with: - project-url: https://github.com/orgs/hedia-team/projects/${{inputs.project-id}} + project-url: https://github.com/orgs/hedia-team/projects/${{inputs.project-id || 2}} github-token: ${{ secrets.ASSIGN_TO_PROJECT_TOKEN }} item-id: ${{ steps.addItem.outputs.itemId }} field-keys: Status