Files
Frontend/.gitea/workflows/deploy.yml
T
d3m0k1d 0f73ca72d7
Deploy / deploy (push) Has been cancelled
ci / build (push) Has been cancelled
feat: container registry deploy (build in CI, pull on server)
2026-06-13 20:56:04 +03:00

37 lines
1.0 KiB
YAML

name: Deploy
on:
push:
branches: [dev]
env:
REGISTRY: gitea.d3m0k1d.ru
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Ansible
run: apt update && apt install -y ansible
- name: Login to registry
run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login $REGISTRY -u "${{ secrets.REGISTRY_USER }}" --password-stdin
- name: Build and push image
run: |
IMAGE=$REGISTRY/hellreign/frontend
docker build -f dockerfile -t $IMAGE:dev -t $IMAGE:${{ gitea.sha }} .
docker push $IMAGE:dev
docker push $IMAGE:${{ gitea.sha }}
- name: Deploy via Ansible
run: |
echo "${{ secrets.ANSIBLE_VAULT_PASSWORD }}" > .vault_pass
ansible-playbook -i infra/ansible/inventory/hosts.yml infra/ansible/playbook.yml \
--vault-password-file .vault_pass \
-e registry=$REGISTRY \
-e tag=${{ gitea.sha }}
rm .vault_pass