Files
email-notification/.gitea/workflows/ci.yaml
teddys48 666449e5c5
Some checks failed
Build and Deploy / cleaning (push) Failing after 1m35s
Build and Deploy / build_image (push) Has been skipped
Build and Deploy / deploy (push) Has been skipped
update
2026-02-11 10:34:46 +07:00

52 lines
1.1 KiB
YAML

name: Build and Deploy
on:
push:
branches:
- main
env:
REGISTRY: localhost:9999
IMAGE_NAME: ${{ secrets.PROJECT_NAME }}
jobs:
cleaning:
runs-on: go
steps:
- name: Cleanup
run: |
docker stop $IMAGE_NAME || true
docker rm $IMAGE_NAME || true
docker container prune -f
docker image prune -af
build_image:
runs-on: node
needs: cleaning
steps:
- uses: actions/checkout@v4
- name: Copy env
run: |
echo "${{ secrets.ENV_FILE }}" > .env
cat .env
- name: Build & Push
run: |
docker build -t $REGISTRY/$IMAGE_NAME:${{ gitea.run_number }} .
docker push $REGISTRY/$IMAGE_NAME:${{ gitea.run_number }}
deploy:
runs-on: node
needs: build_image
steps:
- name: Deploy container
run: |
docker run -d \
--name $IMAGE_NAME \
--memory="50m" \
--cpus="0.1" \
--restart always \
-p 9997:3000 \
$REGISTRY/$IMAGE_NAME:${{ gitea.run_number }}