-
Notifications
You must be signed in to change notification settings - Fork 15
79 lines (71 loc) · 2.41 KB
/
Copy pathci-pre-commit.yml
File metadata and controls
79 lines (71 loc) · 2.41 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
78
79
name: ci-pre-commit
on:
schedule:
# https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07
# This is meant to run at 12:17 UTC on 11th and 26th of every month
- cron: '17 12 11 * *'
- cron: '17 12 26 * *'
push:
branches:
- main
paths:
- '.github/actions/build-ci-image/**'
- '.github/actions/merge-ci-images/**'
- '.github/workflows/ci-pre-commit.yml'
- 'ci/pre-commit/**'
- 'ci/fetch-node.sh'
workflow_dispatch:
env:
REGISTRY_IMAGE: libfn.azurecr.io/ci-pre-commit
NODE_RELEASE: 24
jobs:
build:
if: ${{ github.repository == 'libfn/functional' }}
runs-on: ${{ matrix.platform == 'linux/arm64' && 'warp-ubuntu-latest-arm64-4x' || 'warp-ubuntu-latest-x64-4x' }}
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
sparse-checkout: .github
- uses: ./.github/actions/build-ci-image
with:
platform: ${{ matrix.platform }}
image: ${{ env.REGISTRY_IMAGE }}
tags: |
type=schedule,pattern={{date 'YYYYMMDD'}}
type=raw,value=latest,enable={{is_default_branch}}
type=sha
registry: libfn.azurecr.io
username: ${{ secrets.AZURECR_NAME }}
password: ${{ secrets.AZURECR_PASS }}
build_args: |
NODE_RELEASE=${{ env.NODE_RELEASE }}
context: "ci"
file: "pre-commit/Dockerfile"
title: "pre-commit"
push: ${{ github.ref_type == 'branch' && github.ref_name == 'main' }}
merge:
if: ${{ github.repository == 'libfn/functional' && github.ref_type == 'branch' && github.ref_name == 'main' }}
runs-on: warp-ubuntu-latest-x64-4x
needs:
- build
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
sparse-checkout: .github
- uses: ./.github/actions/merge-ci-images
with:
image: ${{ env.REGISTRY_IMAGE }}
tags: |
type=schedule,pattern={{date 'YYYYMMDD'}}
type=raw,value=latest,enable={{is_default_branch}}
type=sha
registry: libfn.azurecr.io
username: ${{ secrets.AZURECR_NAME }}
password: ${{ secrets.AZURECR_PASS }}
title: "pre-commit"