repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
04ed23f
parent
0abe68c
author
Antonio Mika
date
2023-11-09 01:48:14 +0000 UTC
Break out reused code
2 files changed,  +61, -27
A .github/actions/setup/action.yml
+36, -0
 1@@ -0,0 +1,36 @@
 2+name: Setup main action
 3+
 4+description: Runs the setup required for docker building
 5+
 6+inputs:
 7+  registry:
 8+    description: The docker registry to use
 9+    required: true
10+    default: ghcr.io
11+  username:
12+    description: The docker registry to use
13+    required: true
14+  password:
15+    description: The docker registry to use
16+    required: true
17+
18+runs:
19+  using: composite
20+  steps:
21+    - name: Checkout repo
22+      uses: actions/checkout@v3
23+    - name: Set up QEMU
24+      uses: docker/setup-qemu-action@v2
25+      with:
26+        platforms: all
27+    - name: Set up Docker Buildx
28+      id: buildx
29+      uses: docker/setup-buildx-action@v2
30+      with:
31+        version: latest
32+    - name: Login to Docker Hub
33+      uses: docker/login-action@v2
34+      with:
35+        registry: ${{ inputs.registry }}
36+        username: ${{ inputs.username }}
37+        password: ${{ inputs.password }}
M .github/workflows/build.yml
+25, -27
 1@@ -46,19 +46,8 @@ jobs:
 2       matrix:
 3         APP: [lists, prose, pastes, imgs, pgs, feeds]
 4     steps:
 5-    - name: Checkout repo
 6-      uses: actions/checkout@v3
 7-    - name: Set up QEMU
 8-      uses: docker/setup-qemu-action@v2
 9-      with:
10-        platforms: all
11-    - name: Set up Docker Buildx
12-      id: buildx
13-      uses: docker/setup-buildx-action@v2
14-      with:
15-        version: latest
16-    - name: Login to Docker Hub
17-      uses: docker/login-action@v2
18+    - name: Setup docker
19+      uses: ./.github/actions/setup
20       with:
21         registry: ${{ env.REGISTRY }}
22         username: ${{ github.actor }}
23@@ -69,23 +58,12 @@ jobs:
24         app: ${{ matrix.APP }}
25         platforms: ${{ env.PLATFORMS }}
26         registry: ${{ env.REGISTRY }}
27-  build-misc:
28+  build-auth:
29     runs-on: ubuntu-22.04
30     needs: test
31     steps:
32-    - name: Checkout repo
33-      uses: actions/checkout@v3
34-    - name: Set up QEMU
35-      uses: docker/setup-qemu-action@v2
36-      with:
37-        platforms: all
38-    - name: Set up Docker Buildx
39-      id: buildx
40-      uses: docker/setup-buildx-action@v2
41-      with:
42-        version: latest
43-    - name: Login to Docker Hub
44-      uses: docker/login-action@v2
45+    - name: Setup docker
46+      uses: ./.github/actions/setup
47       with:
48         registry: ${{ env.REGISTRY }}
49         username: ${{ github.actor }}
50@@ -97,6 +75,16 @@ jobs:
51         platforms: ${{ env.PLATFORMS }}
52         registry: ${{ env.REGISTRY }}
53         ssh: false
54+  build-bouncer:
55+    runs-on: ubuntu-22.04
56+    needs: test
57+    steps:
58+    - name: Setup docker
59+      uses: ./.github/actions/setup
60+      with:
61+        registry: ${{ env.REGISTRY }}
62+        username: ${{ github.actor }}
63+        password: ${{ secrets.GITHUB_TOKEN }}
64     - name: Collect bouncer image metadata
65       id: bouncermeta
66       uses: docker/metadata-action@v4
67@@ -112,6 +100,16 @@ jobs:
68         platforms: ${{ env.PLATFORMS }}
69         cache-from: type=gha
70         cache-to: type=gha,mode=max
71+  build-caddy:
72+    runs-on: ubuntu-22.04
73+    needs: test
74+    steps:
75+    - name: Setup docker
76+      uses: ./.github/actions/setup
77+      with:
78+        registry: ${{ env.REGISTRY }}
79+        username: ${{ github.actor }}
80+        password: ${{ secrets.GITHUB_TOKEN }}
81     - name: Collect caddy image metadata
82       id: caddymeta
83       uses: docker/metadata-action@v4