Repository navigation
87 lines (72 loc) · 2.36 KB
/
Copy pathdocker-build-push-dev.yml
File metadata and controls
87 lines (72 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: CI/CD Image dev
on:
workflow_dispatch:
push:
branches: [dev]
paths:
- demo-leptos/**
- demo-tauri/**
- docker/**
- crates/**
- tests/fixtures/**
- Cargo.toml
- Cargo.lock
permissions:
contents: read
packages: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build-push-dev:
name: Build and Push Docker Image :dev / :latest
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Set up Make
run: sudo apt-get install -y make
- name: Build Docker image :dev and :latest
run: make docker-build-dev
- name: Log in to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push :dev and :latest to Docker Hub
run: make docker-push-dev-hub
- name: Log in to GHCR (personal)
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_PAT }}
- name: Push :dev and :latest to personal GHCR
run: make docker-push-dev-ghcr-personal
- name: Log in to GHCR (Interchouette / ITC)
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME_ITC }}
password: ${{ secrets.GHCR_PAT_ITC }}
- name: Push :dev and :latest to ghcr.io/interchouette and interchouette-itc
run: make docker-push-dev-ghcr-itc
- name: Redeploy Render
env:
RENDER_DEPLOY_HOOK_URL: ${{ secrets.RENDER_DEPLOY_HOOK_URL }}
run: |
if [ -z "${RENDER_DEPLOY_HOOK_URL}" ]; then
echo "RENDER_DEPLOY_HOOK_URL secret not set; skipping Render redeploy"
exit 0
fi
hook="$(printf '%s' "$RENDER_DEPLOY_HOOK_URL" | tr -d '\r\n')"
# GET, no body. Do not print the URL (it is the secret).
http_code="$(curl -sS -o /tmp/render-hook.json -w '%{http_code}' --get "$hook")"
echo "render_hook_http=${http_code}"
cat /tmp/render-hook.json
echo
case "$http_code" in
200|202) ;;
*) exit 1 ;;
esac