This commit is contained in:
+14
-16
@@ -1,6 +1,7 @@
|
|||||||
name: Build and deploy Docker image
|
name: Build and deploy Docker image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
@@ -12,24 +13,21 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Isolate Docker auth
|
- name: Build and publish
|
||||||
run: |
|
|
||||||
mkdir -p "$RUNNER_TEMP/docker-config"
|
|
||||||
echo "DOCKER_CONFIG=$RUNNER_TEMP/docker-config" >> "$GITHUB_ENV"
|
|
||||||
|
|
||||||
- name: Login to Gitea Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: gitea.dsrptlab.com
|
|
||||||
username: ${{ gitea.actor }}
|
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
docker build -t "$IMAGE:latest" -t "$IMAGE:${{ gitea.sha }}" .
|
docker build -t "$IMAGE:latest" -t "$IMAGE:${{ gitea.sha }}" .
|
||||||
docker push "$IMAGE:latest"
|
docker push "$IMAGE:latest"
|
||||||
docker push "$IMAGE:${{ gitea.sha }}"
|
docker push "$IMAGE:${{ gitea.sha }}"
|
||||||
docker image rm -f "$IMAGE:latest" "$IMAGE:${{ gitea.sha }}"
|
|
||||||
|
|
||||||
- name: Deploy to Dokploy
|
- name: Remove local image tags
|
||||||
run: curl -fsS -X POST "https://ind.dsrptlab.com/api/deploy/1CoHKHRVGNQ-QYRUNXc-F"
|
run: docker image rm -f "$IMAGE:latest" "$IMAGE:${{ gitea.sha }}"
|
||||||
|
|
||||||
|
- name: Deploy in Dokploy
|
||||||
|
env:
|
||||||
|
DOKPLOY_DEPLOY_WEBHOOK: ${{ secrets.DOKPLOY_DEPLOY_WEBHOOK }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
test -n "$DOKPLOY_DEPLOY_WEBHOOK"
|
||||||
|
curl -fsS -X POST "$DOKPLOY_DEPLOY_WEBHOOK"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user