implement deploy on green
This commit is contained in:
@@ -32,7 +32,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
registry: git.dubyatp.xyz
|
registry: git.dubyatp.xyz
|
||||||
username: williamp
|
username: williamp
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }} # Personal Access Token for authentication
|
password: ${{ secrets.ACTIONS_TOKEN }} # Personal Access Token for authentication
|
||||||
|
|
||||||
# Build and push the Docker image
|
# Build and push the Docker image
|
||||||
- name: Build and Push Docker Image
|
- name: Build and Push Docker Image
|
||||||
@@ -45,4 +45,34 @@ jobs:
|
|||||||
tags: |
|
tags: |
|
||||||
git.dubyatp.xyz/williamp/yt-dlp-bot:latest
|
git.dubyatp.xyz/williamp/yt-dlp-bot:latest
|
||||||
git.dubyatp.xyz/williamp/yt-dlp-bot:${{steps.vars.outputs.sha_short }}
|
git.dubyatp.xyz/williamp/yt-dlp-bot:${{steps.vars.outputs.sha_short }}
|
||||||
# Tags the image with 'latest' and the commit SHA
|
# Tags the image with 'latest' and the commit SHA
|
||||||
|
|
||||||
|
deploy-on-green:
|
||||||
|
needs: build-and-push
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ success() }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout target repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: infrastructure/core-apps
|
||||||
|
token: ${{ secrets.ACTIONS_TOKEN }}
|
||||||
|
ref: main
|
||||||
|
|
||||||
|
- name: Update image tag in deployment.yaml
|
||||||
|
uses: mikefarah/yq@master
|
||||||
|
with:
|
||||||
|
cmd: yq eval '.spec.template.spec.containers[0].image = "git.dubyatp.xyz/williamp/yt-dlp-bot:${{ needs.build-and-push.outputs.sha_short }}"' -i yt-dlp-bot/deployment.yaml
|
||||||
|
|
||||||
|
- name: Commit changes
|
||||||
|
run: |
|
||||||
|
git config --local user.email "actions@noreply.dubyatp.xyz"
|
||||||
|
git config --local user.name "actions[bot]"
|
||||||
|
git commit -a -m "yt-dlp-bot: deploy update to ${{ needs.build-and-push.outputs.sha_short }}"
|
||||||
|
|
||||||
|
- name: Push changes
|
||||||
|
uses: ad-m/github-push-action@v0.8.0
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.ACTIONS_TOKEN }}
|
||||||
|
repository: infrastructure/core-apps
|
||||||
|
branch: main
|
Reference in New Issue
Block a user