ci
This commit is contained in:
47
.gitea/workflows/deploy.yml
Normal file
47
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
name: build and deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: self-hosted
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login to registry
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.REGISTRY_PASS }}" | docker login ${{ secrets.REGISTRY_HOST }} -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
||||||
|
|
||||||
|
- name: Build image
|
||||||
|
run: |
|
||||||
|
docker build -t ${{ secrets.REGISTRY_HOST }}/mintel/mb-grid-solutions:latest .
|
||||||
|
|
||||||
|
- name: Push image
|
||||||
|
run: |
|
||||||
|
docker push ${{ secrets.REGISTRY_HOST }}/mintel/mb-grid-solutions:latest
|
||||||
|
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
needs: build
|
||||||
|
runs-on: self-hosted
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Setup SSH
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
echo "${{ secrets.ALPHA_SSH_KEY }}" > ~/.ssh/id_ed25519
|
||||||
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
|
ssh-keyscan alpha.mintel.me >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
|
- name: Deploy on Alpha
|
||||||
|
run: |
|
||||||
|
ssh deploy@alpha.mintel.me "
|
||||||
|
cd /opt/alpha/sites/mb-grid-solutions &&
|
||||||
|
docker compose pull &&
|
||||||
|
docker compose up -d
|
||||||
|
"
|
||||||
Reference in New Issue
Block a user