-
-
Notifications
You must be signed in to change notification settings - Fork 3
73 lines (61 loc) · 2.22 KB
/
docker-deploy.yml
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
name: Docker Deploy
on:
push:
tags: [ 'v*.*.*' ]
jobs:
set-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
git_tag: ${{ steps.git_info.outputs.tag }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- id: set-matrix
run: |
JSON=$(cat .github/workflows/registry.json | tr '\n' ' ' | sed 's/ //g')
echo "::set-output name=matrix::$JSON"
- id: git_info
run: |
tag=$(echo ${{ github.ref }} | rev | cut -d/ -f1 | rev)
echo "::set-output name=tag::$tag"
docker:
runs-on: ubuntu-latest
needs: [ set-matrix ]
strategy:
matrix:
registry: ${{fromJSON(needs.set-matrix.outputs.matrix)}}
env:
id: ${{ secrets[matrix.registry.id] }}
token: ${{ secrets[matrix.registry.token] }}
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log into Registry ${{ matrix.registry.name }}
uses: docker/login-action@v3
with:
registry: ${{ matrix.registry.registry }}
username: ${{ env.id }}
password: ${{ env.token }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: "lab:latest"
driver: cloud
endpoint: "hominsu/builder"
- name: Build and Push ${{ matrix.registry.name }}
run: >
REPO=${{ matrix.registry.push_link }}
VERSION=${{ needs.set-matrix.outputs.git_tag }}
NEXT_ALGOLIA_APIKEY=${{ secrets.NEXT_ALGOLIA_APIKEY }}
NEXT_ALGOLIA_APPID=${{ secrets.NEXT_ALGOLIA_APPID }}
NEXT_ALGOLIA_INDEX_NAME=${{ secrets.NEXT_ALGOLIA_INDEX_NAME }}
NEXT_PUBLIC_GISCUS_CATEGORY=${{ secrets.NEXT_PUBLIC_GISCUS_CATEGORY }}
NEXT_PUBLIC_GISCUS_CATEGORY_ID=${{ secrets.NEXT_PUBLIC_GISCUS_CATEGORY_ID }}
NEXT_PUBLIC_GISCUS_REPO=${{ secrets.NEXT_PUBLIC_GISCUS_REPO }}
NEXT_PUBLIC_GISCUS_REPOSITORY_ID=${{ secrets.NEXT_PUBLIC_GISCUS_REPOSITORY_ID }}
NEXT_UMAMI_ID=${{ secrets.NEXT_UMAMI_ID }}
docker buildx bake --file deploy/docker-bake.hcl --push