mirror of
https://github.com/morbalint/kemkas-backend.git
synced 2026-07-17 21:23:46 +00:00
let's try to auto deploy new images to beta
This commit is contained in:
+23
-10
@@ -23,20 +23,33 @@ jobs:
|
|||||||
run: doctl registry login --expiry-seconds 1200
|
run: doctl registry login --expiry-seconds 1200
|
||||||
- name: Log in to GitHub Container Registry
|
- name: Log in to GitHub Container Registry
|
||||||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||||
|
- run: |
|
||||||
|
echo "GITHUB_SHA_SHORT=$(echo ${GITHUB_SHA::8})" >> $GITHUB_ENV
|
||||||
|
echo "registry.digitalocean.com/kemkas/kemkas-be:${GITHUB_SHA::8}"
|
||||||
|
echo "ghcr.io/${{ github.repository_owner }}/kemkas-backend:${GITHUB_SHA::8}"
|
||||||
- uses: docker/build-push-action@v5
|
- uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: Kemkas.Web/Dockerfile
|
file: Kemkas.Web/Dockerfile
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
push: false
|
push: true
|
||||||
load: true
|
load: true
|
||||||
tags: kemkas/kemkas-be:edge
|
tags:
|
||||||
- name: Tag container image
|
registry.digitalocean.com/kemkas/kemkas-be:${{ env.GITHUB_SHA_SHORT }}
|
||||||
run: |
|
ghcr.io/${{ github.repository_owner }}/kemkas-backend:${{ env.GITHUB_SHA_SHORT }}
|
||||||
docker tag kemkas/kemkas-be:edge registry.digitalocean.com/kemkas/kemkas-be:${GITHUB_SHA::8}
|
- uses: actions/checkout@v4
|
||||||
docker tag kemkas/kemkas-be:edge ghcr.io/${{ github.repository_owner }}/kemkas-backend:${GITHUB_SHA::8}
|
with:
|
||||||
- name: Push image to Container Registry
|
repository: morbalint/kemkas-deployment
|
||||||
run: |
|
ref: refs/head/main
|
||||||
docker push registry.digitalocean.com/kemkas/kemkas-be:${GITHUB_SHA::8}
|
path: ./deployment-repo
|
||||||
docker push ghcr.io/${{ github.repository_owner }}/kemkas-backend:${GITHUB_SHA::8}
|
clean: false
|
||||||
|
- uses: mikefarah/yq@v4
|
||||||
|
with:
|
||||||
|
cmd: yq -i '.spec.template.spec.container[0].image = "registry.digitalocean.com/kemkas/kemkas-be:${{ env.GITHUB_SHA_SHORT }}"' ./deployment-repo/kemkas-beta/kemkas-be-deployment.yaml
|
||||||
|
- run: |
|
||||||
|
cd ./deployment-repo
|
||||||
|
git config --add user.email "deployment-bot@kemkas.hu"
|
||||||
|
git config --add user.name "Deployment Bot"
|
||||||
|
git commit -a -m "deploy registry.digitalocean.com/kemkas/kemkas-be:${{ env.GITHUB_SHA_SHORT }}"
|
||||||
|
git push
|
||||||
Reference in New Issue
Block a user