|
6 | 6 | tagVersion: |
7 | 7 | description: "Tag Version (semver - x.x.x)" |
8 | 8 | required: true |
9 | | - push: |
10 | | - tags: |
11 | | - - '[0-9]+.[0-9]+.[0-9]+' |
12 | 9 |
|
13 | 10 | jobs: |
14 | 11 | check-branches: |
|
27 | 24 | name: Continuous Integration |
28 | 25 | uses: ./.github/workflows/__shared-ci.yml |
29 | 26 |
|
| 27 | + update_release_draft: |
| 28 | + # we want to publish a new tag only if ci succeeds |
| 29 | + needs: ci |
| 30 | + permissions: |
| 31 | + contents: write |
| 32 | + pull-requests: write |
| 33 | + runs-on: self-hosted |
| 34 | + steps: |
| 35 | + - id: update_release_draft |
| 36 | + uses: release-drafter/release-drafter@v6 |
| 37 | + env: |
| 38 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 39 | + with: |
| 40 | + publish: true |
| 41 | + disable-autolabeler: true |
| 42 | + |
| 43 | + - uses: docker/login-action@v3 |
| 44 | + with: |
| 45 | + registry: "ghcr.io" |
| 46 | + username: ${{ github.repository_owner }} |
| 47 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 48 | + |
| 49 | + - uses: docker/login-action@v3 |
| 50 | + with: |
| 51 | + registry: "docker.io" |
| 52 | + username: ${{ secrets.DOCKERHUB_REGISTRY_USER }} |
| 53 | + password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} |
| 54 | + |
| 55 | + - name: Push built images to Docker.io |
| 56 | + run: | |
| 57 | + APP_IMAGE="${{ fromJson(needs.ci.outputs.built-images).app.images[0] }}" |
| 58 | + docker pull "$APP_IMAGE" |
| 59 | + APP_TAG="${{ steps.update_release_draft.outputs.tag_name }}" |
| 60 | + APP_REGISTRY_PATH="docker.io/webofmars" |
| 61 | + APP_DOCKERIO_IMAGE="${APP_REGISTRY_PATH}/http-header-authenticator:$APP_TAG" |
| 62 | + docker tag "$APP_IMAGE" "$APP_DOCKERIO_IMAGE" |
| 63 | + docker push "$APP_DOCKERIO_IMAGE" |
| 64 | +
|
30 | 65 | helm-push: |
31 | 66 | name: 👷♂️ Run helm push |
32 | 67 | needs: ci |
|
64 | 99 | update-dependencies: true |
65 | 100 | version: ${{ github.event.inputs.tagVersion }} |
66 | 101 | appVersion: ${{ github.event.inputs.tagVersion }} |
67 | | - |
68 | | - release: |
69 | | - name: 📦 Release |
70 | | - needs: |
71 | | - - skaffold-build |
72 | | - - helm-push |
73 | | - runs-on: self-hosted |
74 | | - steps: |
75 | | - - uses: tibdex/github-app-token@v2 |
76 | | - id: generate-token |
77 | | - with: |
78 | | - app_id: ${{ vars.CI_BOT_APP_ID }} |
79 | | - private_key: ${{ secrets.CI_BOT_APP_PRIVATE_KEY }} |
80 | | - |
81 | | - # checkout code |
82 | | - - uses: actions/checkout@v4 |
83 | | - with: |
84 | | - fetch-depth: 0 |
85 | | - |
86 | | - - name: Generate changelog |
87 | | - id: changelog |
88 | | - uses: metcalfc/changelog-generator@v4.3.1 |
89 | | - with: |
90 | | - myToken: ${{ steps.generate-token.outputs.token }} |
91 | | - |
92 | | - - name: Create a GitHub release |
93 | | - uses: actions/create-release@v1 |
94 | | - env: |
95 | | - GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} |
96 | | - with: |
97 | | - tag_name: ${{ github.event.inputs.tagVersion }} |
98 | | - release_name: Release ${{ github.event.inputs.tagVersion }} |
99 | | - body: ${{ steps.changelog.outputs.changelog }} |
|
0 commit comments