Skip to content

Commit 31e2ff7

Browse files
committed
Merge branch 'main' into issue-2762-shareable-workflow
2 parents 83ced38 + d6e83db commit 31e2ff7

File tree

95 files changed

+5669
-717
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+5669
-717
lines changed

.github/workflows/deploy-dev.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ jobs:
6363
cache-from: type=gha,scope=backend
6464
cache-to: type=gha,scope=backend,mode=max
6565

66+
- name: Build Emails
67+
uses: docker/build-push-action@v3
68+
with:
69+
context: emails
70+
push: true
71+
tags: ${{ secrets.DO_REGISTRY_PATH }}/webrecorder/browsertrix-emails:latest
72+
cache-from: type=gha,scope=emails
73+
cache-to: type=gha,scope=emails,mode=max
74+
6675
- name: Build Frontend
6776
uses: docker/build-push-action@v3
6877
env:

.github/workflows/emails-build.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Emails Build
2+
on: pull_request
3+
4+
# Cancel in progress workflows on pull_requests.
5+
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
# In order to be able to have required checks, a workflow can't be entirely
12+
# skipped: see https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks
13+
paths-filter:
14+
name: "Changed files?"
15+
runs-on: ubuntu-latest
16+
outputs:
17+
matches: ${{ steps.filter.outputs.matches }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 2 # important, to fetch previous commit
22+
23+
# workaround for https://github.com/dorny/paths-filter/issues/240
24+
- id: previous-sha
25+
run: 'echo "sha=$(git rev-parse HEAD^1)" >> $GITHUB_OUTPUT'
26+
27+
- uses: dorny/paths-filter@v3
28+
id: filter
29+
with:
30+
base: "${{ steps.previous-sha.outputs.sha }}"
31+
filters: |
32+
matches:
33+
- 'emails/**'
34+
- '.github/workflows/emails-build.yaml'
35+
36+
build:
37+
name: Build
38+
runs-on: ubuntu-latest
39+
needs: paths-filter
40+
if: needs.paths-filter.outputs.matches == 'true'
41+
strategy:
42+
matrix:
43+
node: [20, 22]
44+
steps:
45+
# Setup:
46+
- name: Checkout
47+
uses: actions/checkout@v4
48+
with:
49+
ref: ${{ github.head_ref }}
50+
51+
- name: Setup Node
52+
uses: actions/setup-node@v4
53+
with:
54+
node-version: ${{ matrix.node }}
55+
cache: "yarn"
56+
cache-dependency-path: emails/yarn.lock
57+
58+
- name: Install dependencies
59+
working-directory: emails
60+
env:
61+
HUSKY: 0
62+
run: yarn install --frozen-lockfile
63+
64+
# Check build:
65+
- name: Set up Docker Buildx
66+
uses: docker/setup-buildx-action@v3
67+
with:
68+
driver-opts: network=host
69+
70+
- name: Build Email Service
71+
uses: docker/build-push-action@v3
72+
with:
73+
context: emails
74+
load: true
75+
tags: webrecorder/browsertrix-emails:latest
76+
cache-from: type=gha,scope=emails
77+
cache-to: type=gha,scope=emails,mode=max

.github/workflows/k3d-ci.yaml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v4
2424
with:
25-
fetch-depth: 2 # important, to fetch previous commit
25+
fetch-depth: 2 # important, to fetch previous commit
2626

2727
# workaround for https://github.com/dorny/paths-filter/issues/240
2828
- id: previous-sha
@@ -36,6 +36,7 @@ jobs:
3636
matches:
3737
- 'backend/**'
3838
- 'chart/**'
39+
- 'emails/**'
3940
- '.github/workflows/k3d-ci.yaml'
4041
4142
btrix-k3d-test:
@@ -51,6 +52,7 @@ jobs:
5152
cluster-name: btrix-1
5253
args: >-
5354
-p "30870:30870@agent:0:direct"
55+
-p "30872:30872@agent:0:direct"
5456
--agents 1
5557
--no-lb
5658
--k3s-arg "--disable=traefik,servicelb,metrics-server@server:*"
@@ -73,6 +75,16 @@ jobs:
7375
cache-from: type=gha,scope=backend
7476
cache-to: type=gha,scope=backend,mode=max
7577

78+
- name: Build Emails
79+
uses: docker/build-push-action@v3
80+
with:
81+
context: emails
82+
load: true
83+
#outputs: type=tar,dest=emails.tar
84+
tags: webrecorder/browsertrix-emails:latest
85+
cache-from: type=gha,scope=emails
86+
cache-to: type=gha,scope=emails,mode=max
87+
7688
- name: Build Frontend
7789
uses: docker/build-push-action@v3
7890
with:
@@ -83,15 +95,16 @@ jobs:
8395
cache-from: type=gha,scope=frontend
8496
cache-to: type=gha,scope=frontend,mode=max
8597

86-
- name: 'Import Images'
98+
- name: "Import Images"
8799
run: |
88100
k3d image import webrecorder/browsertrix-backend:latest -m direct -c btrix-1 --verbose
101+
k3d image import webrecorder/browsertrix-emails:latest -m direct -c btrix-1 --verbose
89102
k3d image import webrecorder/browsertrix-frontend:latest -m direct -c btrix-1 --verbose
90103
91104
- name: Install Kubectl
92105
uses: azure/setup-kubectl@v3
93106
with:
94-
version: v1.28.2
107+
version: v1.28.2
95108

96109
- name: Install Helm
97110
uses: azure/setup-helm@v3
@@ -121,13 +134,17 @@ jobs:
121134
run: pytest -vv ./backend/test/test_*.py
122135

123136
- name: Print Backend Logs (API)
124-
if: ${{ failure() }}
137+
if: ${{ always() }}
125138
run: kubectl logs svc/browsertrix-cloud-backend -c api
126139

127140
- name: Print Backend Logs (Operator)
128-
if: ${{ failure() }}
141+
if: ${{ always() }}
129142
run: kubectl logs svc/browsertrix-cloud-backend -c op
130143

144+
- name: Print Emails Logs
145+
if: ${{ always() }}
146+
run: kubectl logs svc/browsertrix-cloud-emails -c api
147+
131148
- name: Print K8S Events
132-
if: ${{ failure() }}
149+
if: ${{ always() }}
133150
run: kubectl events --all-namespaces

.github/workflows/k3d-log-ci.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ on:
55
branches:
66
- main
77
paths:
8-
- 'backend/**'
9-
- 'chart/**'
8+
- "backend/**"
9+
- "chart/**"
10+
- "emails/**"
1011

1112
jobs:
1213
btrix-k3d-admin-logging-test:
@@ -30,7 +31,7 @@ jobs:
3031
- name: Install Helm
3132
uses: azure/setup-helm@v3
3233
with:
33-
version: 3.10.2
34+
version: 3.10.2
3435

3536
- name: Add hosts to /etc/hosts
3637
run: |
@@ -43,7 +44,7 @@ jobs:
4344
POD=$(kubectl get pods -A | grep nginx-ingress | head -n 1 | awk '{print $2}')
4445
while [[ $(kubectl get pods $POD -n kube-system -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do kubectl get pods -n kube-system; sleep 5; done
4546
sleep 20
46-
47+
4748
- name: Start Cluster with Helm (chart/admin/logging)
4849
run: |
4950
./chart/admin/logging/scripts/eck_install.sh

.github/workflows/k3d-nightly-ci.yaml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Nightly tests (K3d)
33
on:
44
schedule:
55
# Run daily at 8am UTC
6-
- cron: '0 8 * * *'
6+
- cron: "0 8 * * *"
77

88
workflow_dispatch:
99

@@ -59,6 +59,16 @@ jobs:
5959
cache-from: type=gha,scope=backend
6060
cache-to: type=gha,scope=backend,mode=max
6161

62+
- name: Build Emails
63+
uses: docker/build-push-action@v3
64+
with:
65+
context: emails
66+
load: true
67+
#outputs: type=tar,dest=emails.tar
68+
tags: webrecorder/browsertrix-emails:latest
69+
cache-from: type=gha,scope=emails
70+
cache-to: type=gha,scope=emails,mode=max
71+
6272
- name: Build Frontend
6373
uses: docker/build-push-action@v3
6474
with:
@@ -69,9 +79,10 @@ jobs:
6979
cache-from: type=gha,scope=frontend
7080
cache-to: type=gha,scope=frontend,mode=max
7181

72-
- name: 'Import Images'
82+
- name: "Import Images"
7383
run: |
7484
k3d image import webrecorder/browsertrix-backend:latest -m direct -c btrix-nightly --verbose
85+
k3d image import webrecorder/browsertrix-emails:latest -m direct -c btrix-nightly --verbose
7586
k3d image import webrecorder/browsertrix-frontend:latest -m direct -c btrix-nightly --verbose
7687
7788
- name: Install Kubectl
@@ -89,7 +100,7 @@ jobs:
89100
- name: Install Python
90101
uses: actions/setup-python@v5
91102
with:
92-
python-version: '3.x'
103+
python-version: "3.x"
93104

94105
- name: Install Python Libs
95106
run: pip install -r ./backend/test-requirements.txt
@@ -98,15 +109,19 @@ jobs:
98109
run: kubectl wait --for=condition=ready pod --all --timeout=240s
99110

100111
- name: Create Extra Test Buckets
101-
run: kubectl exec -i deployment/local-minio -c minio -- mkdir /data/replica-0
112+
run: kubectl exec -i deployment/local-minio -c minio -- mkdir /data/replica-0
102113

103114
- name: Run Tests
104115
run: pytest -vv ./backend/test_nightly/${{ matrix.module }}
105116

106117
- name: Print Backend Logs (API)
107-
if: ${{ failure() }}
118+
if: ${{ always() }}
108119
run: kubectl logs svc/browsertrix-cloud-backend -c api
109120

110121
- name: Print Backend Logs (Operator)
111-
if: ${{ failure() }}
122+
if: ${{ always() }}
112123
run: kubectl logs svc/browsertrix-cloud-backend -c op
124+
125+
- name: Print Emails Logs
126+
if: ${{ always() }}
127+
run: kubectl logs svc/browsertrix-cloud-emails -c api

.github/workflows/microk8s-ci.yaml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ on:
55
branches:
66
- main
77
paths:
8-
- 'backend/**'
9-
- 'chart/**'
10-
- '.github/workflows/microk8s-ci.yaml'
8+
- "backend/**"
9+
- "chart/**"
10+
- ".github/workflows/microk8s-ci.yaml"
1111
workflow_dispatch:
1212

1313
env:
@@ -19,7 +19,7 @@ jobs:
1919
steps:
2020
- uses: balchua/microk8s-actions@v0.3.1
2121
with:
22-
channel: '1.25/stable'
22+
channel: "1.25/stable"
2323
addons: '["dns", "helm3", "hostpath-storage", "registry", "host-access"]'
2424
- name: Checkout
2525
uses: actions/checkout@v3
@@ -41,6 +41,15 @@ jobs:
4141
cache-from: type=gha,scope=backend
4242
cache-to: type=gha,scope=backend,mode=max
4343

44+
- name: Build Emails
45+
uses: docker/build-push-action@v3
46+
with:
47+
context: emails
48+
push: true
49+
tags: localhost:32000/webrecorder/browsertrix-emails:latest
50+
cache-from: type=gha,scope=emails
51+
cache-to: type=gha,scope=emails,mode=max
52+
4453
- name: Build Frontend
4554
uses: docker/build-push-action@v3
4655
with:
@@ -60,7 +69,7 @@ jobs:
6069
- name: Install Python
6170
uses: actions/setup-python@v5
6271
with:
63-
python-version: '3.x'
72+
python-version: "3.x"
6473

6574
- name: Install Python Libs
6675
run: pip install -r ./backend/test-requirements.txt
@@ -72,5 +81,9 @@ jobs:
7281
run: pytest -vv ./backend/test/test_*.py
7382

7483
- name: Print Backend Logs
75-
if: ${{ failure() }}
84+
if: ${{ always() }}
7685
run: sudo microk8s kubectl logs svc/browsertrix-cloud-backend
86+
87+
- name: Print Emails Logs
88+
if: ${{ always() }}
89+
run: sudo microk8s kubectl logs svc/browsertrix-cloud-emails

.github/workflows/release.yaml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,28 @@ jobs:
99
runs-on: ubuntu-22.04
1010

1111
steps:
12-
-
13-
name: Checkout
12+
- name: Checkout
1413
uses: actions/checkout@v3
1514

16-
-
17-
name: Set up QEMU
15+
- name: Set up QEMU
1816
uses: docker/setup-qemu-action@v2
1917

20-
-
21-
name: Set up Docker Buildx
18+
- name: Set up Docker Buildx
2219
uses: docker/setup-buildx-action@v3
2320

24-
-
25-
name: Login to Docker Hub
21+
- name: Login to Docker Hub
2622
uses: docker/login-action@v2
2723
with:
2824
username: ${{ secrets.DOCKER_USERNAME }}
2925
password: ${{ secrets.DOCKER_PASSWORD }}
3026

31-
-
32-
name: Set Env Vars
27+
- name: Set Env Vars
3328
run: |
3429
echo VERSION=`cat version.txt` >> $GITHUB_ENV
3530
echo GIT_COMMIT_HASH=`git rev-parse --short HEAD` >> $GITHUB_ENV
3631
echo GIT_BRANCH_NAME=`git rev-parse --abbrev-ref HEAD` >> $GITHUB_ENV
3732
38-
-
39-
name: Build Backend
33+
- name: Build Backend
4034
uses: docker/build-push-action@v4
4135
with:
4236
context: backend
@@ -46,8 +40,17 @@ jobs:
4640
cache-from: type=gha,scope=backend
4741
cache-to: type=gha,scope=backend,mode=max
4842

49-
-
50-
name: Build Frontend
43+
- name: Build Emails
44+
uses: docker/build-push-action@v4
45+
with:
46+
context: emails
47+
platforms: linux/amd64,linux/arm64
48+
push: true
49+
tags: ${{ env.REPO_PREFIX }}webrecorder/browsertrix-emails:${{ env.VERSION }}, webrecorder/browsertrix-emails:latest
50+
cache-from: type=gha,scope=emails
51+
cache-to: type=gha,scope=emails,mode=max
52+
53+
- name: Build Frontend
5154
uses: docker/build-push-action@v4
5255
env:
5356
HUSKY: 0

0 commit comments

Comments
 (0)