-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (81 loc) · 2.94 KB
/
Copy pathpipeline-image.yml
File metadata and controls
93 lines (81 loc) · 2.94 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Pipeliner Image
# Build (and optionally push) Pipeliner — VCR appliance for sandbox deposit/read.
# VCR: vcr.vercel.com/gerald-davis-projects/bitcode/pipeliner
on:
push:
branches:
- version/**
- main
paths:
- 'containers/images/pipeliner/**'
- 'packages/pipeline-hosts/**'
- 'packages/host-generics/**'
- 'packages/asset-packs-pipelines/**'
- 'packages/lsp/**'
- 'packages/pipelines-generics/**'
- 'packages/btd/**'
- 'pnpm-lock.yaml'
- '.github/workflows/pipeline-image.yml'
workflow_dispatch:
inputs:
push_to_vcr:
description: 'Push Pipeliner image to VCR (requires secrets)'
required: false
default: 'false'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
materialize-and-build:
name: Materialize runners + Docker build
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '24'
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Materialize Pipeliner runners
run: pnpm --filter @bitcode/pipeline-image run materialize
- name: Pipeliner unit test
run: pnpm --filter @bitcode/pipeline-image test
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Pipeliner image (local tag)
env:
PIPELINER: vcr.vercel.com/gerald-davis-projects/bitcode/pipeliner
run: |
SHORT_SHA="$(echo "$GITHUB_SHA" | cut -c1-7)"
docker build \
-f containers/images/pipeliner/Dockerfile \
-t "${PIPELINER}:ci-${SHORT_SHA}" \
-t "${PIPELINER}:latest" \
.
- name: Log in to VCR and push Pipeliner
if: ${{ github.event_name == 'workflow_dispatch' && inputs.push_to_vcr == 'true' }}
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}
PIPELINER: vcr.vercel.com/gerald-davis-projects/bitcode/pipeliner
run: |
if [ -z "$VERCEL_TOKEN" ] || [ -z "$VERCEL_TEAM_ID" ]; then
echo "Missing VERCEL_TOKEN or VERCEL_TEAM_ID" >&2
exit 1
fi
printf '%s' "$VERCEL_TOKEN" | docker login vcr.vercel.com \
--username "$VERCEL_TEAM_ID" \
--password-stdin
SHORT_SHA="$(echo "$GITHUB_SHA" | cut -c1-7)"
docker tag "${PIPELINER}:ci-${SHORT_SHA}" "${PIPELINER}:v48-${SHORT_SHA}"
docker push --all-tags "${PIPELINER}"
echo "Pushed ${PIPELINER}:latest and ${PIPELINER}:v48-${SHORT_SHA}"
echo "Set Production BITCODE_PIPELINE_SANDBOX_IMAGE=${PIPELINER}:v48-${SHORT_SHA}"