-
Notifications
You must be signed in to change notification settings - Fork 37
72 lines (69 loc) · 2.64 KB
/
oursky.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
name: Custom Build in oursky/authgear-server
on:
push:
branches:
- '*'
- '!gh-pages'
tags:
- '*'
jobs:
authgear-image-custom:
if: ${{ github.repository == 'oursky/authgear-server' }}
runs-on: [self-hosted, linux, x64, v1]
steps:
- uses: actions/checkout@v4
# 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
eval $(ssh-agent -a $SSH_AUTH_SOCK)
printf "$AUTHGEAR_PRIVATE_DEPLOY_KEY" | base64 --decode | ssh-add -
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> "$GITHUB_ENV"
echo "SSH_AGENT_PID=$SSH_AGENT_PID" >> "$GITHUB_ENV"
- run: make -C custombuild build-image TARGET=authgearx IMAGE_NAME=authgear-server-custom
- name: Clean up SSH key
if: ${{ always() }}
run: |
ssh-add -D
ssh-agent -k
echo "SSH_AUTH_SOCK=" >> "$GITHUB_ENV"
echo "SSH_AGENT_PID=" >> "$GITHUB_ENV"
- name: Push
env:
REPO_PREFIX: ${{ secrets.AUTHGEAR_CUSTOM_BUILD_REPO_PREFIX }}
run: |
make -C custombuild tag-image IMAGE_NAME=authgear-server-custom REMOTE_IMAGE_NAME="$REPO_PREFIX/authgear-server"
make -C custombuild push-image REMOTE_IMAGE_NAME="$REPO_PREFIX/authgear-server"
portal-image-custom:
if: ${{ github.repository == 'oursky/authgear-server' }}
runs-on: [self-hosted, linux, x64, v1]
steps:
- uses: actions/checkout@v4
# 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
eval $(ssh-agent -a $SSH_AUTH_SOCK)
printf "$AUTHGEAR_PRIVATE_DEPLOY_KEY" | base64 --decode | ssh-add -
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> "$GITHUB_ENV"
echo "SSH_AGENT_PID=$SSH_AGENT_PID" >> "$GITHUB_ENV"
- run: make -C custombuild build-image TARGET=portalx IMAGE_NAME=authgear-portal-custom
- name: Clean up SSH key
if: ${{ always() }}
run: |
ssh-add -D
ssh-agent -k
echo "SSH_AUTH_SOCK=" >> "$GITHUB_ENV"
echo "SSH_AGENT_PID=" >> "$GITHUB_ENV"
- name: Push
env:
REPO_PREFIX: ${{ secrets.AUTHGEAR_CUSTOM_BUILD_REPO_PREFIX }}
run: |
make -C custombuild tag-image IMAGE_NAME=authgear-portal-custom REMOTE_IMAGE_NAME="$REPO_PREFIX/authgear-portal"
make -C custombuild push-image REMOTE_IMAGE_NAME="$REPO_PREFIX/authgear-portal"