Skip to content

Commit 61020ea

Browse files
committed
add deploy setup
1 parent 598f4c4 commit 61020ea

File tree

3 files changed

+42
-8
lines changed

3 files changed

+42
-8
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ jobs:
5858
uses: docker/metadata-action@v5
5959
with:
6060
images: ${{ env.REGISTRY_NAMESPACE }}/${{ matrix.target }}
61+
flavor: |
62+
latest=true
6163
6264
- name: Login to Docker Registry
6365
uses: docker/login-action@v3
@@ -129,6 +131,8 @@ jobs:
129131
uses: docker/metadata-action@v5
130132
with:
131133
images: ${{ env.REGISTRY_NAMESPACE }}/${{ matrix.target }}
134+
flavor: |
135+
latest=true
132136
133137
- name: Create manifest list and push
134138
run: |

.github/workflows/uikit-site.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy Caddy
1+
name: Deploy UIkit Site
22

33
on:
44
push:
@@ -16,8 +16,6 @@ jobs:
1616
secrets: inherit
1717

1818
deploy:
19-
if: github.ref == 'refs/heads/main'
20-
2119
needs: [build]
2220

2321
runs-on: ubuntu-latest
@@ -29,9 +27,8 @@ jobs:
2927
- name: Run playbook
3028
uses: dawidd6/action-ansible-playbook@v4
3129
with:
32-
playbook: playbooks/caddy/setup.yml
30+
playbook: scripts/playbook.yml
3331
key: ${{ secrets.ACTIONS_SSH_PRIVATE_KEY }}
34-
inventory: ${{ secrets.SITE_HOST }},
35-
options: --extra-vars "github_username=${{ github.actor }} github_token=${{ secrets.GITHUB_TOKEN }}"
36-
configuration: |
37-
[defaults]
32+
inventory: |
33+
[uikit]
34+
${{ secrets.SITE_HOST }}

scripts/playbook.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
- name: Setup UIkit Site
3+
4+
hosts:
5+
- uikit
6+
7+
vars:
8+
uikit:
9+
image: "{{ uikit_image | default('ghcr.io/uikit/uikit-site:latest') }}"
10+
domain: "{{ uikit_domain | default('uikit.' + ansible_default_ipv4.address + '.sslip.io') }}"
11+
12+
tasks:
13+
- name: Pull image from GitHub Container Registry
14+
community.docker.docker_image:
15+
name: "{{ uikit.image }}"
16+
source: pull
17+
force_source: true
18+
19+
- name: Deploy uikit-site
20+
community.docker.docker_container:
21+
name: uikit
22+
image: "{{ uikit.image }}"
23+
networks:
24+
- name: "{{ caddy_network | default('caddy') }}"
25+
labels:
26+
caddy: "{{ uikit.domain }}"
27+
caddy.reverse_proxy: !unsafe "{{upstreams 80}}"
28+
restart_policy: unless-stopped
29+
30+
- name: Setup complete
31+
ansible.builtin.debug:
32+
msg: |
33+
- UIkit Site! is available at: https://{{ uikit.domain }}

0 commit comments

Comments
 (0)