Skip to content

Commit

Permalink
Clone wp post
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonardo Mendoza Fernadez authored and Leonardo Mendoza Fernadez committed Apr 25, 2024
1 parent d1bb333 commit 772de05
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion .github/workflows/clone-post.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,42 @@ jobs:
else
git commit -m "Cloned WordPress post ${{ github.event.inputs.postID }} for environment ${{ github.event.inputs.environment }}"
git push
fi
- name: Get the current version tag
id: get_version
run: |
TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "Current version tag: $TAG"
echo "::set-output name=version::${TAG}"
- name: Calculate new version
id: new_version
run: |
CURRENT_VERSION=${{ steps.get_version.outputs.version }}
MAJOR=$(echo $CURRENT_VERSION | cut -d'.' -f1)
MINOR=$(echo $CURRENT_VERSION | cut -d'.' -f2)
PATCH=$(echo $CURRENT_VERSION | cut -d'.' -f3)
NEW_PATCH=$((PATCH + 1))
NEW_VERSION="${MAJOR}.${MINOR}.${NEW_PATCH}"
echo "New version: $NEW_VERSION"
echo "::set-output name=new_version::$NEW_VERSION"
- name: Create and push tag
run: |
NEW_TAG=${{ steps.new_version.outputs.new_version }}
git tag $NEW_TAG
git push origin $NEW_TAG
- name: Create GitHub release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.new_version.outputs.new_version }}
release_name: Release ${{ steps.new_version.outputs.new_version }}
draft: false
prerelease: false

upload_to_s3:
needs: clone_post
runs-on: ubuntu-latest
Expand Down

0 comments on commit 772de05

Please sign in to comment.