[3640169] New Docker Trigger Action release #24
Workflow file for this run
This file contains 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
name: Docker trigger Build Action | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
build-docker-image: | |
name: Build Docker Image | |
runs-on: ubuntu-latest | |
outputs: | |
release_version: ${{ steps.version.outputs.version }} | |
pr_log: ${{ steps.pr-log.outputs.pr-log }} | |
commit_log: ${{ steps.pr-log.outputs.commit_log }} | |
steps: | |
- uses: actions/[email protected] | |
- name: Build and Push Docker Image | |
run: | | |
echo "standing by mode" | |
- name: get the versin from package.json | |
id: version | |
run: | | |
version=$(jq -r ".version" package.json) | |
echo "version=${version}" | |
echo "version=${version}" >> $GITHUB_OUTPUT | |
- name: Get PR titles and authors | |
id: pr-log | |
env: | |
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} | |
run: | | |
echo "pr-log=$(gh pr list --search "is:merged merged:>$(git log -1 --format=%aI $(git describe --tags --always --abbrev=0 HEAD^))" --json title,author --jq '.[] | " \n - [x] " + .title + " by @" + .author.login' | tr '\n' ', ')" >> $GITHUB_OUTPUT | |
create-new-release: | |
name: Create New Release π | |
runs-on: ubuntu-latest | |
needs: [build-docker-image] | |
# check if there is a new tag | |
permissions: | |
contents: write | |
id-token: write | |
pull-requests: write | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 # Fetch all history for all tags and branches | |
- name: Get contributors | |
env: | |
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} | |
run: | | |
CONTRIBUTORS=$(gh api repos/${{ github.repository }}/contributors --jq 'map(.login) | join(", @")') | |
echo "CONTRIBUTORS=@$CONTRIBUTORS" >> $GITHUB_ENV | |
- name: Create Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} | |
run: | | |
gh release create v$(jq -r ".version" package.json) \ | |
--title "v$(jq -r ".version" package.json)" \ | |
--notes "## π What's new in this release: | |
- [x] New Docker Image Release $(jq -r ".version" package.json ) | |
## ππΎ Thank You: | |
A big thank you to all our amazing engineers and maintainers | |
" | |