This repository has been archived by the owner on Nov 13, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 17
188 lines (160 loc) · 6.93 KB
/
build_houston_fe.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: Build
on:
pull_request:
branches:
- main
- develop
push:
branches:
- main
- develop
tags:
- v*
schedule:
- cron: '0 16 * * *' # Every day at 16:00 UTC (~09:00 PT)
jobs:
build:
name: Build releasable package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/[email protected]
with:
node-version: '17.x'
- name: Install dependencies and compile
run: ./scripts/build.npm.sh
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 10
- name: Package the build
run: |
mv dist codex-frontend
tar -czvf codex-frontend.tar.gz codex-frontend/
- uses: actions/upload-artifact@v2
with:
name: codex-frontend
path: codex-frontend.tar.gz
# default:
# retention-days: 90
deploy:
name: Docker image build
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
if: github.event_name == 'schedule'
with:
ref: develop
- uses: actions/checkout@v2
if: github.event_name != 'schedule'
- uses: docker/setup-qemu-action@v1
name: Set up QEMU
id: qemu
with:
image: tonistiigi/binfmt:latest
platforms: all
- uses: docker/setup-buildx-action@v1
name: Set up Docker Buildx
id: buildx
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
# Build images
- name: Build Codex
run: |
./scripts/buildx.docker.sh -i houston-frontend
# Log into container registries
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: wildmeorg
password: ${{ secrets.WBIA_WILDMEBOT_DOCKER_HUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PAT }}
# Push tagged image (version tag + latest) to registries
- name: Tagged Docker Hub
if: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') }}
run: |
VERSION=$(echo ${GITHUB_REF} | sed 's#.*/v##')
./scripts/buildx.docker.sh -t ${VERSION} -i houston-frontend
./scripts/buildx.docker.sh -t latest -i houston-frontend
- name: Tagged GHCR
if: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') }}
run: |
VERSION=$(echo ${GITHUB_REF} | sed 's#.*/v##')
./scripts/buildx.docker.sh -t ${VERSION} -r ghcr.io/wildmeorg/codex-frontend -i houston-frontend
./scripts/buildx.docker.sh -t latest -r ghcr.io/wildmeorg/codex-frontend -i houston-frontend
# Push stable image (main tag) to registries
- name: Stable Docker Hub
if: github.ref == 'refs/heads/main'
run: |
./scripts/buildx.docker.sh -t main -i houston-frontend
- name: Stable GHCR
if: github.ref == 'refs/heads/main'
run: |
./scripts/buildx.docker.sh -t main -r ghcr.io/wildmeorg/codex-frontend -i houston-frontend
# Push bleeding-edge image (develop tag) to registries
- name: Bleeding Edge Docker Hub
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
run: |
./scripts/buildx.docker.sh -t develop -i houston-frontend
- name: Bleeding Edge GHCR
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
run: |
./scripts/buildx.docker.sh -t develop -r ghcr.io/wildmeorg/codex-frontend -i houston-frontend
# Push nightly image (nightly tag) to registries
- name: Nightly Docker Hub
if: github.event_name == 'schedule'
run: |
./scripts/buildx.docker.sh -t nightly -i houston-frontend
- name: Nightly GHCR
if: github.event_name == 'schedule'
run: |
./scripts/buildx.docker.sh -t nightly -r ghcr.io/wildmeorg/codex-frontend -i houston-frontend
# Notify status in Slack
- name: Slack Notification
if: ${{ failure() && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') }}
uses: rtCamp/action-slack-notify@master
env:
SLACK_CHANNEL: dev-houston
SLACK_COLOR: '#FF0000'
SLACK_ICON: https://avatars.slack-edge.com/2020-03-02/965719891842_db87aa21ccb61076f236_44.png
SLACK_MESSAGE: 'Tagged / Latest Docker build of Codex Frontend failed :sob:'
SLACK_USERNAME: "GitHub CI"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
- name: Slack Notification
if: ${{ failure() && github.ref == 'refs/heads/main' }}
uses: rtCamp/action-slack-notify@master
env:
SLACK_CHANNEL: dev-houston
SLACK_COLOR: '#FF0000'
SLACK_ICON: https://avatars.slack-edge.com/2020-03-02/965719891842_db87aa21ccb61076f236_44.png
SLACK_MESSAGE: 'Stable Docker build of Codex Frontend failed :sob:'
SLACK_USERNAME: "GitHub CI"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
- name: Slack Notification
if: ${{ failure() && github.ref == 'refs/heads/develop' }}
uses: rtCamp/action-slack-notify@master
env:
SLACK_CHANNEL: dev-houston
SLACK_COLOR: '#FF0000'
SLACK_ICON: https://avatars.slack-edge.com/2020-03-02/965719891842_db87aa21ccb61076f236_44.png
SLACK_MESSAGE: 'Bleeding Edge Docker build of Codex Frontend failed :sob:'
SLACK_USERNAME: "GitHub CI"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
- name: Slack Notification
if: ${{ failure() && github.event_name == 'schedule' }}
uses: rtCamp/action-slack-notify@master
env:
SLACK_CHANNEL: dev-houston
SLACK_COLOR: '#FF0000'
SLACK_ICON: https://avatars.slack-edge.com/2020-03-02/965719891842_db87aa21ccb61076f236_44.png
SLACK_MESSAGE: 'Nightly Docker build of Codex Frontend failed :sob:'
SLACK_USERNAME: "GitHub CI"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}