-
Notifications
You must be signed in to change notification settings - Fork 1
chore(ci): add release-please and version tags to DockerHub release process #450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
omercnet
wants to merge
4
commits into
main
Choose a base branch
from
shuni/task-20260326171521
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
bd0521c
ci: add release-please and gate DockerHub releases on version tags
omercnet 51d0be0
ci: move DockerHub publish to release-please workflow and fix securit…
omercnet 160e1e1
Merge branch 'main' into shuni/task-20260326171521
omercnet ee4f887
Merge branch 'main' into shuni/task-20260326171521
omercnet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| name: Release Please | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| release-please: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| release_created: ${{ steps.release.outputs.release_created }} | ||
| steps: | ||
| - name: Generate GitHub App Token | ||
| id: app-token | ||
| uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 | ||
| with: | ||
| app-id: ${{ secrets.RELEASE_APP_ID }} | ||
| private-key: ${{ secrets.RELEASE_APP_PEM }} | ||
|
|
||
| - name: Release Please | ||
| uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0 | ||
| id: release | ||
| with: | ||
| token: ${{ steps.app-token.outputs.token }} | ||
| release-type: go | ||
|
|
||
| publish-dockerhub: | ||
| name: Publish to Docker Hub | ||
| runs-on: ubuntu-latest | ||
| needs: [release-please] | ||
| if: needs.release-please.outputs.release_created == 'true' | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
|
||
| - name: Generate GitHub App Token | ||
| id: app-token | ||
| uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 | ||
| with: | ||
| app-id: ${{ secrets.RELEASE_APP_ID }} | ||
| private-key: ${{ secrets.RELEASE_APP_PEM }} | ||
|
|
||
| - name: Setup repository dependencies | ||
| id: setup | ||
| uses: ./.github/actions/setup | ||
| env: | ||
| RELEASE_APP_ID: ${{ secrets.RELEASE_APP_ID }} | ||
| RELEASE_APP_PEM: ${{ secrets.RELEASE_APP_PEM }} | ||
|
|
||
| - name: Setup build args | ||
| id: setup-build-args | ||
| shell: bash | ||
| run: | | ||
| source configs/dev/deploy.env || true | ||
| source configs/dev/config.env || true | ||
| echo "build_dir=${BUILD_DIR}" >> "${GITHUB_OUTPUT}" | ||
| echo "port=${PORT}" >> "${GITHUB_OUTPUT}" | ||
| echo "repo_name=${REPO_NAME}" >> "${GITHUB_OUTPUT}" | ||
| echo "dockerfile=vendor/github.com/descope/common/build/docker/service/Dockerfile" >> "${GITHUB_OUTPUT}" | ||
|
|
||
| - name: Login to Docker Hub | ||
| uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0 | ||
| with: | ||
| registry: docker.io | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Extract metadata for Docker Hub | ||
| id: meta-dockerhub | ||
| uses: ./.github/actions/docker-metadata | ||
| with: | ||
| images: docker.io/descope/${{ steps.setup-build-args.outputs.repo_name }} | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 | ||
| with: | ||
| version: latest | ||
| cache-binary: false | ||
|
|
||
| - name: Build and push to Docker Hub | ||
| uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2 | ||
| with: | ||
| context: . | ||
| file: ${{ steps.setup-build-args.outputs.dockerfile }} | ||
| push: true | ||
| platforms: linux/amd64,linux/arm64 | ||
| tags: ${{ steps.meta-dockerhub.outputs.tags }} | ||
| labels: ${{ steps.meta-dockerhub.outputs.labels }} | ||
| annotations: ${{ steps.meta-dockerhub.outputs.annotations }} | ||
| secrets: | | ||
| "github_token=${{ steps.app-token.outputs.token }}" | ||
| build-args: | | ||
| build_dir=${{ steps.setup-build-args.outputs.build_dir }} | ||
| port=${{ steps.setup-build-args.outputs.port }} | ||
| repo_name=${{ steps.setup-build-args.outputs.repo_name }} | ||
| GIT_SHA=${{ github.sha }} | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
|
|
||
| - name: Update Docker Hub README | ||
| uses: peter-evans/dockerhub-description@1b9a80c056b620d92cedb9d9b5a223409c68ddfa # v5.0.0 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
| repository: descope/${{ steps.setup-build-args.outputs.repo_name }} | ||
| readme-filepath: ./README.md |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.