-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from deepak7340/test-tag
Test tag
- Loading branch information
Showing
6 changed files
with
107 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: CI build | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Deploy Docker image to Google Cloud Run | ||
run: env |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: mongodump | ||
|
||
on: | ||
- push | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get Latest Tag | ||
id: latest_tag | ||
run: echo "::set-output name=tag::$(git describe --abbrev=0 --tags)" | ||
|
||
- name: Display Latest Tags | ||
run: echo "Latest tag is ${{ steps.latest_tag.outputs.tag }}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: CI notify | ||
|
||
# Only trigger, when the build workflow succeeded | ||
on: | ||
workflow_run: | ||
workflows: ["CI build"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
notify: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Notify Slack and send eMail | ||
run: env |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Create New Tag | ||
|
||
on: | ||
workflow_run: | ||
workflows: | ||
- "mongodump" | ||
types: | ||
- completed | ||
|
||
jobs: | ||
build_master: | ||
if: github.ref == 'refs/heads/master' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Increment Tag and Create New Tag | ||
id: increment_tag | ||
run: | | ||
latest_tag=${{ github.event.workflow_run.outputs.tag }} | ||
# Extract the numeric part of the tag and increment it | ||
tag_number=$(echo "$latest_tag" | sed 's/v//') | ||
new_tag_number=$((tag_number + 1)) | ||
new_tag="v$new_tag_number" | ||
git tag $new_tag | ||
echo "::set-output name=new_tag::$new_tag" | ||
- name: Push New Tag | ||
run: | | ||
new_tag=${{ steps.increment_tag.outputs.new_tag }} | ||
git push origin $new_tag | ||
build_other_branches: | ||
if: github.ref != 'refs/heads/master' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get the Branch name | ||
id: tag | ||
run: | | ||
TAG=$(echo "${{ github.ref }}" | sed -e "s/refs\/tags\///")" | ||
echo "::set-output name=tag::$TAG" | ||
- name: Build and push | ||
env: | ||
TAG: ${{ steps.tag.outputs.TAG }} | ||
run: | | ||
echo "Building Docker image with tag: $TAG" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# tags | ||
# tags testing |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# tags testing |