Skip to content

Commit

Permalink
Merge pull request #1 from deepak7340/test-tag
Browse files Browse the repository at this point in the history
Test tag
  • Loading branch information
deepak7340 authored Aug 5, 2023
2 parents 5193db1 + 14c92dc commit 0b233be
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .github/workflows/1.yml
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
21 changes: 21 additions & 0 deletions .github/workflows/build-tag.yml
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 }}"
18 changes: 18 additions & 0 deletions .github/workflows/env.yml
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
53 changes: 53 additions & 0 deletions .github/workflows/tag-print.yml
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"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# tags
# tags testing
1 change: 1 addition & 0 deletions deepak/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# tags testing

0 comments on commit 0b233be

Please sign in to comment.