-
-
Notifications
You must be signed in to change notification settings - Fork 64
77 lines (68 loc) · 2.31 KB
/
emails-build.yaml
File metadata and controls
77 lines (68 loc) · 2.31 KB
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
name: Emails Build
on: pull_request
# Cancel in progress workflows on pull_requests.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
# In order to be able to have required checks, a workflow can't be entirely
# 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
paths-filter:
name: "Changed files?"
runs-on: ubuntu-latest
outputs:
matches: ${{ steps.filter.outputs.matches }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2 # important, to fetch previous commit
# workaround for https://github.com/dorny/paths-filter/issues/240
- id: previous-sha
run: 'echo "sha=$(git rev-parse HEAD^1)" >> $GITHUB_OUTPUT'
- uses: dorny/paths-filter@v3
id: filter
with:
base: "${{ steps.previous-sha.outputs.sha }}"
filters: |
matches:
- 'emails/**'
- '.github/workflows/emails-build.yaml'
build:
name: Build
runs-on: ubuntu-latest
needs: paths-filter
if: needs.paths-filter.outputs.matches == 'true'
strategy:
matrix:
node: [20, 22]
steps:
# Setup:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: "yarn"
cache-dependency-path: emails/yarn.lock
- name: Install dependencies
working-directory: emails
env:
HUSKY: 0
run: yarn install --frozen-lockfile
# Check build:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
- name: Build Email Service
uses: docker/build-push-action@v3
with:
context: emails
load: true
tags: webrecorder/browsertrix-emails:latest
cache-from: type=gha,scope=emails
cache-to: type=gha,scope=emails,mode=max