Github actions: Automatically update deployment configuration file
This commit is contained in:
parent
5bb1c61647
commit
661ba8dd42
@ -36,4 +36,26 @@ jobs:
|
|||||||
- name: Build and Push Docker Image
|
- name: Build and Push Docker Image
|
||||||
run: |
|
run: |
|
||||||
docker build -t ghcr.io/gansejunge/${{ env.IMAGE_NAME }}:${{ steps.get_tag.outputs.next }} .
|
docker build -t ghcr.io/gansejunge/${{ env.IMAGE_NAME }}:${{ steps.get_tag.outputs.next }} .
|
||||||
docker push ghcr.io/gansejunge/${{ env.IMAGE_NAME }}:${{ steps.get_tag.outputs.next }}
|
docker push ghcr.io/gansejunge/${{ env.IMAGE_NAME }}:${{ steps.get_tag.outputs.next }}
|
||||||
|
|
||||||
|
- name: Clone ops-deployment repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: notifier/ops-deployment
|
||||||
|
path: ./ops-deployment
|
||||||
|
token: ${{ secrets.BOT_TOKEN }}
|
||||||
|
|
||||||
|
- name: Update service-docker-repository-query deployment
|
||||||
|
working-directory: ./ops-deployment
|
||||||
|
run: |
|
||||||
|
NEW_TAG=${{ steps.get_tag.outputs.next }}
|
||||||
|
NEW_IMAGE="${{ env.IMAGE_PATH }}:$NEW_TAG"
|
||||||
|
git config user.name "automation-bot"
|
||||||
|
git config user.email "dev@gansejunge.com"
|
||||||
|
|
||||||
|
sed -i "s|ghcr.io/$GHCR_ORG/$IMAGE_NAME:[0-9]\+|$NEW_IMAGE|g" "$OPS_PATH"
|
||||||
|
|
||||||
|
COMMIT_URL="https://git.gansejunge.com/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}"
|
||||||
|
git add $OPS_PATH
|
||||||
|
git commit -m "Update service-docker-repository-query image to version $NEW_TAG" -m "Linked build commit: $COMMIT_URL"
|
||||||
|
git push origin $OPS_BRANCH_BASE
|
||||||
Loading…
x
Reference in New Issue
Block a user