From a1023cae7d83202d5091f8172565ae33c46f05e6 Mon Sep 17 00:00:00 2001 From: Justus Zeinert <33062216+velramiir@users.noreply.github.com> Date: Thu, 12 Oct 2023 15:23:46 +0200 Subject: [PATCH 1/3] chore: add manual docker build action (#92) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Ticket 🎫 This closes https://github.com/dot-base/icd-10-api/issues/93 # Description 📖 This adds a `workflow_dispatch` for a manual docker image build from any branch. --- .../workflows/build-docker-image-manually.yml | 29 +++++++++++++++++++ .github/workflows/manage-pr.yml | 1 + 2 files changed, 30 insertions(+) create mode 100644 .github/workflows/build-docker-image-manually.yml diff --git a/.github/workflows/build-docker-image-manually.yml b/.github/workflows/build-docker-image-manually.yml new file mode 100644 index 0000000..2db5a2c --- /dev/null +++ b/.github/workflows/build-docker-image-manually.yml @@ -0,0 +1,29 @@ +name: Build Docker Image For Branch + +on: + workflow_dispatch: + inputs: + architecture: + type: choice + required: true + default: amd64 + options: + - amd64 + - arm64 + - both + imageTag: + type: string + required: true + description: "For example: 1.0.0" + +jobs: + build-docker-image: + name: Build Docker Image for ${{ inputs.imageTag }} + uses: dot-base/.github/.github/workflows/build-docker-image-manually.yml@main + with: + architecture: ${{ inputs.architecture }} + imageTag: ${{ inputs.imageTag }} + secrets: + GH_BOT_USER: ${{ secrets.GH_BOT_USER }} + GH_BOT_PAT: ${{ secrets.GH_BOT_PAT }} + CR_PAT: ${{ secrets.CR_PAT }} diff --git a/.github/workflows/manage-pr.yml b/.github/workflows/manage-pr.yml index 7e48295..9fc9bbc 100644 --- a/.github/workflows/manage-pr.yml +++ b/.github/workflows/manage-pr.yml @@ -17,3 +17,4 @@ jobs: secrets: GH_BOT_USER: ${{ secrets.GH_BOT_USER }} GH_BOT_PAT: ${{ secrets.GH_BOT_PAT }} + CR_PAT: ${{ secrets.CR_PAT }} From 0de4dae5d775400366156ba1cd655ead3f770a2d Mon Sep 17 00:00:00 2001 From: Chris Heyer Date: Tue, 17 Oct 2023 15:44:10 +0200 Subject: [PATCH 2/3] chore: Rename lint and test scripts (#94) Rename test and lint scripts to test:ci and lint:ci --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8d2f999..70a9ac1 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "debug": "nodemon --watch 'src/**/*' -e ts --exec 'npm run lint && npm run prettier && npm run debugger'", "debug-brk": "nodemon --watch 'src/**/*' -e ts --exec 'npm run lint && npm run prettier && npm run debugger-brk'", "lint": "eslint 'src/**/*.ts' 'tests/**/*.ts' --fix", - "lint-without-fix": "eslint 'src/**/*.ts' 'tests/**/*.ts'", - "test": "jest --passWithNoTests", + "lint:ci": "eslint 'src/**/*.ts' 'tests/**/*.ts'", + "test:ci": "jest --passWithNoTests", "prettier": "prettier --write 'src/**/*.ts' 'tests/**/*.ts'", "debugger": "NODE_ENV=development node --require ts-node/register --inspect=0.0.0.0:9229 src/server.ts", "debugger-brk": "NODE_ENV=development node --require ts-node/register --inspect-brk=0.0.0.0:9229 src/server.ts", @@ -60,4 +60,4 @@ "prettier": { "printWidth": 100 } -} +} \ No newline at end of file From 2ab8feb3dcb87c568f09e130cad2b08367a20e77 Mon Sep 17 00:00:00 2001 From: Justus Zeinert <33062216+velramiir@users.noreply.github.com> Date: Wed, 15 Nov 2023 15:50:10 +0100 Subject: [PATCH 3/3] chore: new release automation (with hotfix) (#96) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Ticket 🎫 This closes https://github.com/dot-base/deployments/issues/192 # Description 📖 This updates the actions for the new release process with hotfixes. --- .../workflows/build-docker-image-manually.yml | 29 ---------------- .github/workflows/build-docker-image.yml | 34 +++++++++++++++++++ .../workflows/create-hotfix-release-pr.yml | 20 +++++++++++ .github/workflows/create-pre-release.yml | 14 -------- .github/workflows/create-sync-pr.yml | 11 ++++++ .github/workflows/manage-pr.yml | 1 + 6 files changed, 66 insertions(+), 43 deletions(-) delete mode 100644 .github/workflows/build-docker-image-manually.yml create mode 100644 .github/workflows/build-docker-image.yml create mode 100644 .github/workflows/create-hotfix-release-pr.yml delete mode 100644 .github/workflows/create-pre-release.yml create mode 100644 .github/workflows/create-sync-pr.yml diff --git a/.github/workflows/build-docker-image-manually.yml b/.github/workflows/build-docker-image-manually.yml deleted file mode 100644 index 2db5a2c..0000000 --- a/.github/workflows/build-docker-image-manually.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Build Docker Image For Branch - -on: - workflow_dispatch: - inputs: - architecture: - type: choice - required: true - default: amd64 - options: - - amd64 - - arm64 - - both - imageTag: - type: string - required: true - description: "For example: 1.0.0" - -jobs: - build-docker-image: - name: Build Docker Image for ${{ inputs.imageTag }} - uses: dot-base/.github/.github/workflows/build-docker-image-manually.yml@main - with: - architecture: ${{ inputs.architecture }} - imageTag: ${{ inputs.imageTag }} - secrets: - GH_BOT_USER: ${{ secrets.GH_BOT_USER }} - GH_BOT_PAT: ${{ secrets.GH_BOT_PAT }} - CR_PAT: ${{ secrets.CR_PAT }} diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml new file mode 100644 index 0000000..11d58d7 --- /dev/null +++ b/.github/workflows/build-docker-image.yml @@ -0,0 +1,34 @@ +name: 🐳 Build Docker Image + +on: + workflow_dispatch: + inputs: + ref: + type: string + required: true + description: "The ref to build the image from. (usually this is a release tag, e.g. v4.0.1)" + architecture: + type: choice + required: true + default: amd64 + options: + - amd64 + - arm64 + - both + imageTag: + type: string + required: true + description: "The tag for the docker image. (usually a version tag without leading 'v')" + +jobs: + build-docker-image: + name: Build Docker Image for ${{ inputs.imageTag }} + uses: dot-base/.github/.github/workflows/build-docker-image.yml@main + with: + ref: ${{ inputs.ref }} + architecture: ${{ inputs.architecture }} + imageTag: ${{ inputs.imageTag }} + secrets: + GH_BOT_USER: ${{ secrets.GH_BOT_USER }} + GH_BOT_PAT: ${{ secrets.GH_BOT_PAT }} + CR_PAT: ${{ secrets.CR_PAT }} diff --git a/.github/workflows/create-hotfix-release-pr.yml b/.github/workflows/create-hotfix-release-pr.yml new file mode 100644 index 0000000..8cd57e4 --- /dev/null +++ b/.github/workflows/create-hotfix-release-pr.yml @@ -0,0 +1,20 @@ +name: 🚒 Create Hotfix Release PR + +on: + workflow_dispatch: + inputs: + branch: + type: string + description: The hotfix branch with the fix that shall be released. + required: true + default: fix/ + +jobs: + create-release-PR: + name: Create a PR from the hotfix branch into 'release' + uses: dot-base/.github/.github/workflows/create-release-pr.yml@main + with: + branch: ${{ inputs.branch }} + secrets: + GH_BOT_USER: ${{ secrets.GH_BOT_USER }} + GH_BOT_PAT: ${{ secrets.GH_BOT_PAT }} diff --git a/.github/workflows/create-pre-release.yml b/.github/workflows/create-pre-release.yml deleted file mode 100644 index bdb27d7..0000000 --- a/.github/workflows/create-pre-release.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Create Pre-Release - -on: - pull_request: - branches: - - main - types: [closed] - -jobs: - create-pre-release: - name: Create Pre-Release - uses: dot-base/.github/.github/workflows/create-pre-release.yml@main - secrets: - CR_PAT: ${{ secrets.CR_PAT }} diff --git a/.github/workflows/create-sync-pr.yml b/.github/workflows/create-sync-pr.yml new file mode 100644 index 0000000..3c4723c --- /dev/null +++ b/.github/workflows/create-sync-pr.yml @@ -0,0 +1,11 @@ +name: 🔁 Create Sync PR (manual version) + +on: workflow_dispatch + +jobs: + create-release-pr: + name: Create Sync PR + uses: dot-base/.github/.github/workflows/create-sync-pr.yml@main + secrets: + GH_BOT_USER: ${{ secrets.GH_BOT_USER }} + GH_BOT_PAT: ${{ secrets.GH_BOT_PAT }} diff --git a/.github/workflows/manage-pr.yml b/.github/workflows/manage-pr.yml index 9fc9bbc..ea28f5e 100644 --- a/.github/workflows/manage-pr.yml +++ b/.github/workflows/manage-pr.yml @@ -5,6 +5,7 @@ on: branches: - main - release + - 'sync/*' pull_request_review: types: - submitted