-
Notifications
You must be signed in to change notification settings - Fork 37
84 lines (81 loc) · 3.74 KB
/
custom-build.yaml
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
name: Custom Build
on:
push:
branches:
- '*'
- '!gh-pages'
tags:
- '*'
pull_request:
branches:
- '*'
- '!gh-pages'
jobs:
authgear-image-custom:
runs-on: ubuntu-22.04
if: ${{ github.repository == 'authgear/authgear-server' }}
steps:
- uses: actions/checkout@v3
# https://aran.dev/posts/github-actions-go-private-modules/
- name: Set up SSH key
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
AUTHGEAR_PRIVATE_DEPLOY_KEY: ${{ secrets.AUTHGEAR_PRIVATE_DEPLOY_KEY }}
run: |
mkdir -p ~/.ssh
ssh-agent -a $SSH_AUTH_SOCK
printf "$AUTHGEAR_PRIVATE_DEPLOY_KEY" | base64 --decode | ssh-add -
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> "$GITHUB_ENV"
- run: make -C custombuild build-image TARGET=authgearx IMAGE_NAME=authgear-server-custom
- name: Push to HK
env:
DOCKER_PASSWORD: ${{ secrets.AUTHGEAR_CUSTOM_BUILD_SERVICE_ACCOUNT_KEY_HK }}
REPO: ${{ secrets.AUTHGEAR_CUSTOM_BUILD_REPO_HK }}
REPO_PREFIX: ${{ secrets.AUTHGEAR_CUSTOM_BUILD_REPO_PREFIX_HK }}
run: |
make -C custombuild tag-image IMAGE_NAME=authgear-server-custom REMOTE_IMAGE_NAME="$REPO_PREFIX/authgear-server"
printf "$DOCKER_PASSWORD" | docker login --username _json_key_base64 --password-stdin "$REPO"
make -C custombuild push-image REMOTE_IMAGE_NAME="$REPO_PREFIX/authgear-server"
- name: Push to US
env:
DOCKER_PASSWORD: ${{ secrets.AUTHGEAR_CUSTOM_BUILD_SERVICE_ACCOUNT_KEY_US }}
REPO: ${{ secrets.AUTHGEAR_CUSTOM_BUILD_REPO_US }}
REPO_PREFIX: ${{ secrets.AUTHGEAR_CUSTOM_BUILD_REPO_PREFIX_US }}
run: |
make -C custombuild tag-image IMAGE_NAME=authgear-server-custom REMOTE_IMAGE_NAME="$REPO_PREFIX/authgear-server"
printf "$DOCKER_PASSWORD" | docker login --username _json_key_base64 --password-stdin "$REPO"
make -C custombuild push-image REMOTE_IMAGE_NAME="$REPO_PREFIX/authgear-server"
portal-image-custom:
runs-on: ubuntu-22.04
if: ${{ github.repository == 'authgear/authgear-server' }}
steps:
- uses: actions/checkout@v3
# https://aran.dev/posts/github-actions-go-private-modules/
- name: Set up SSH key
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
AUTHGEAR_PRIVATE_DEPLOY_KEY: ${{ secrets.AUTHGEAR_PRIVATE_DEPLOY_KEY }}
run: |
mkdir -p ~/.ssh
ssh-agent -a $SSH_AUTH_SOCK
printf "$AUTHGEAR_PRIVATE_DEPLOY_KEY" | base64 --decode | ssh-add -
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> "$GITHUB_ENV"
- run: make -C custombuild build-image TARGET=portalx IMAGE_NAME=authgear-portal-custom
- name: Push to HK
env:
DOCKER_PASSWORD: ${{ secrets.AUTHGEAR_CUSTOM_BUILD_SERVICE_ACCOUNT_KEY_HK }}
REPO: ${{ secrets.AUTHGEAR_CUSTOM_BUILD_REPO_HK }}
REPO_PREFIX: ${{ secrets.AUTHGEAR_CUSTOM_BUILD_REPO_PREFIX_HK }}
run: |
make -C custombuild tag-image IMAGE_NAME=authgear-portal-custom REMOTE_IMAGE_NAME="$REPO_PREFIX/authgear-portal"
printf "$DOCKER_PASSWORD" | docker login --username _json_key_base64 --password-stdin "$REPO"
make -C custombuild push-image REMOTE_IMAGE_NAME="$REPO_PREFIX/authgear-portal"
- name: Push to US
env:
DOCKER_PASSWORD: ${{ secrets.AUTHGEAR_CUSTOM_BUILD_SERVICE_ACCOUNT_KEY_US }}
REPO: ${{ secrets.AUTHGEAR_CUSTOM_BUILD_REPO_US }}
REPO_PREFIX: ${{ secrets.AUTHGEAR_CUSTOM_BUILD_REPO_PREFIX_US }}
run: |
make -C custombuild tag-image IMAGE_NAME=authgear-portal-custom REMOTE_IMAGE_NAME="$REPO_PREFIX/authgear-portal"
printf "$DOCKER_PASSWORD" | docker login --username _json_key_base64 --password-stdin "$REPO"
make -C custombuild push-image REMOTE_IMAGE_NAME="$REPO_PREFIX/authgear-portal"