Skip to content

fix: comment out GET /blogs/{BlogId} route handling in lift-club-lamb… #7

fix: comment out GET /blogs/{BlogId} route handling in lift-club-lamb…

fix: comment out GET /blogs/{BlogId} route handling in lift-club-lamb… #7

name: lokos-blog-crud CI-CD
on:
push:
branches:
- main
paths:
- 'lokos-blog-crud/**' # Run only if changes are in lokos-blog-crud directory
jobs:
release:
runs-on: ubuntu-latest
steps:
# 1. Checkout the code
- name: Checkout Code
uses: actions/checkout@v3
# 2. Read current version from versions.json
- name: Read Current Version
id: read_version
run: |
VERSION=$(jq -r '."lokos-blog-crud"' versions.json)
echo "Current version: $VERSION"
echo "VERSION=${VERSION}" >> $GITHUB_ENV
# 3. Increment the patch version
- name: Increment Patch Version
id: increment_version
run: |
OLD_VERSION=${{ env.VERSION }}
IFS='.' read -r MAJOR MINOR PATCH <<< "$OLD_VERSION"
NEW_PATCH=$((PATCH + 1))
NEW_VERSION="${MAJOR}.${MINOR}.${NEW_PATCH}"
echo "New version: $NEW_VERSION"
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
# 4. Create a zip file for the directory
- name: Zip Directory
run: |
ZIP_NAME=lokos-blog-crud-${{ env.NEW_VERSION }}.zip
cd lokos-blog-crud
zip -r ../$ZIP_NAME ./*
echo "ZIP_NAME=$ZIP_NAME" >> $GITHUB_ENV
# 5.1 Authenticate to AWS
- name: Authenticate to AWS
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
# 5.2 Back up release version to s3
- name: Upload File
run: |
aws s3 cp ${{ env.ZIP_NAME }} s3://mea-munera-lambda/lokos-blog-crud/
# 6. Update the versions.json file in the root
- name: Update Versions JSON
run: |
jq --arg version "${{ env.NEW_VERSION }}" '."lokos-blog-crud" = $version' versions.json > versions.json.tmp
mv versions.json.tmp versions.json
cat versions.json
# 7. Commit and Push the updated versions.json
- name: Commit Versions JSON
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add versions.json
git commit -m "Update lokos-blog-crud version to ${{ env.NEW_VERSION }}"
git push