beerds/.gitea/workflows/ai.yaml

35 lines
1.3 KiB
YAML

name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions
on: [push]
jobs:
build_and_push:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
steps:
- name: Checkout
uses: actions/checkout@v2 # Required to mount the Github Workspace to a volume
- name: Login to Docker Hub
uses: https://github.com/docker/login-action@v3
with:
registry: gitea.webart-tech.ru
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: LFS
run: |
git lfs pull
- name: Build and push
uses: https://github.com/docker/build-push-action@v5
with:
context: .
push: true
tags: gitea.webart-tech.ru/webart/beerds/backend:${{ gitea.sha }}
- name: Deploy
run: |
git clone https://${{ secrets.DOCKER_USERNAME }}:${{ secrets.DOCKER_PASSWORD }}@gitea.webart-tech.ru/webart/kuber-deploy.git deploy
cd ./deploy/ai
sed -i -E 's/backend:.+/backend:${{ gitea.sha }}/g' dogs.yml
git config --global user.email "deploy@deploy.deploy"
git commit -am 'auto-deploy'
git push https://${{ secrets.DOCKER_USERNAME }}:${{ secrets.DOCKER_PASSWORD }}@gitea.webart-tech.ru/webart/kuber-deploy