Simplify CI workflow - build only (no SSH deploy yet)
Some checks failed
Build and Deploy hatch.surf / build (push) Failing after 27s
Some checks failed
Build and Deploy hatch.surf / build (push) Failing after 27s
- Removed SSH deploy step (needs secrets configuration) - Build Docker image and save locally - Can add deployment step later with proper secrets Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
8bce1cb670
commit
a416994aea
@ -1,4 +1,4 @@
|
|||||||
name: Deploy hatch.surf
|
name: Build and Deploy hatch.surf
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -9,7 +9,7 @@ env:
|
|||||||
IMAGE_NAME: hatch-web
|
IMAGE_NAME: hatch-web
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-deploy:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -23,16 +23,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
docker build -t ${{ env.IMAGE_NAME }}:${{ github.sha }} .
|
docker build -t ${{ env.IMAGE_NAME }}:${{ github.sha }} .
|
||||||
docker tag ${{ env.IMAGE_NAME }}:${{ github.sha }} ${{ env.IMAGE_NAME }}:latest
|
docker tag ${{ env.IMAGE_NAME }}:${{ github.sha }} ${{ env.IMAGE_NAME }}:latest
|
||||||
|
echo "Docker image built successfully"
|
||||||
|
docker images | grep ${{ env.IMAGE_NAME }}
|
||||||
|
|
||||||
- name: Deploy to server
|
- name: Save Docker image
|
||||||
uses: appleboy/ssh-action@v1
|
run: |
|
||||||
with:
|
docker save ${{ env.IMAGE_NAME }}:latest | gzip > /tmp/${{ env.IMAGE_NAME }}.tar.gz
|
||||||
host: ${{ secrets.SERVER_HOST }}
|
echo "Image saved to /tmp/${{ env.IMAGE_NAME }}.tar.gz"
|
||||||
username: ${{ secrets.SERVER_USER }}
|
ls -lh /tmp/${{ env.IMAGE_NAME }}.tar.gz
|
||||||
key: ${{ secrets.SERVER_SSH_KEY }}
|
|
||||||
script: |
|
|
||||||
cd /home/nara/repos/hatch-surf
|
|
||||||
git pull origin main
|
|
||||||
docker compose build
|
|
||||||
docker compose up -d --remove-orphans
|
|
||||||
docker system prune -f
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user