61 lines
1.8 KiB
YAML
61 lines
1.8 KiB
YAML
name: Update Repo Version Workflow
|
|
|
|
on:
|
|
workflow_call:
|
|
|
|
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
|
|
|
|
- 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 }} #THis is because we want to trigger a new build
|
|
# 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
|