deploy-tools/.github/workflows/cs-update-push.yml
2025-02-10 02:08:43 +05:30

65 lines
1.9 KiB
YAML

name: Update Repo Version Workflow
on:
workflow_call:
secrets:
bot_build_repo_token:
required: true
jobs:
cs-update-push:
runs-on: ubuntu-22.04
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- id: read-issue
name: Read the issue comment
run: |
ISSUE_COMMENT_STRING='${{ github.event.comment.body }}'
DOCKER_BASE=`echo $ISSUE_COMMENT_STRING | jq ".image"`
BUILD_ID=`echo $ISSUE_COMMENT_STRING | jq ".tag"`
echo "DOCKER_BASE=$DOCKER_BASE" >> "$GITHUB_OUTPUT";
echo "BUILD_ID=$BUILD_ID" >> "$GITHUB_OUTPUT";
- name: Print IMAGE and TAG
run: |
echo "BUILD_ID: ${{ steps.read-issue.outputs.BUILD_ID }}";
echo "DOCKER_BASE: ${{ steps.read-issue.outputs.DOCKER_BASE }}";
- uses: actions/checkout@v4
with:
path: cs
token: ${{ secrets.bot_build_repo_token }} #This is because we want to trigger a new build
- name: Checkout deploy-tools
uses: actions/checkout@v4
with:
repository: gmetribin/deploy-tools
ref: main
path: deploy-tools
token: ${{ github.token }}
- name: Increment package version and push
# env:
# GITHUB_TOKEN: ${{ secrets.PAT }}
# GITHUB_TOKEN: ${{ github.token }}
run: |
git config --global user.name 'bot-build'
git config --global user.email 'techbots+build@gmetri.com'
BUILD_ID=${{ steps.read-issue.outputs.BUILD_ID }}
DOCKER_BASE=${{ steps.read-issue.outputs.DOCKER_BASE }}
REPOLIST=./.github/repolist.txt
pwd; ls -al;
cd cs;
../deploy-tools/src/repo_to_cs.sh -m $DOCKER_BASE -t $BUILD_ID -r $REPOLIST
git push origin main
git push --tags origin main