-
Notifications
You must be signed in to change notification settings - Fork 2.1k
98 lines (87 loc) · 3.27 KB
/
environment.yml
File metadata and controls
98 lines (87 loc) · 3.27 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
94
95
96
97
98
name: Environment Suite
on:
workflow_call:
inputs:
ref:
description: 'Git ref to checkout'
required: false
type: string
workflow_dispatch:
inputs:
push:
description: "Push image when manually triggered"
type: boolean
default: false
ref:
description: 'Git ref to checkout'
required: false
type: string
schedule:
- cron: '0 6 * * 1' # Every Monday at 06:00 UTC
env:
VERBOSE: true
CI: true
SHOULD_PUBLISH: ${{ (github.event_name != 'workflow_dispatch' && github.ref == 'refs/heads/master') || (github.event_name == 'workflow_dispatch' && github.event.inputs.push == 'true') }}
permissions:
contents: read
jobs:
publish-new-environment:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Checkout branch
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ inputs.ref }}
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- name: Login to DockerHub
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
if: env.SHOULD_PUBLISH == 'true'
with:
username: ${{ secrets.CI_DOCKER_USERNAME }}
password: ${{ secrets.CI_DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
with:
images: timberio/vector-dev
flavor: |
latest=true
tags: type=sha, format=long
labels: |
org.opencontainers.image.description=Image for Vector's Docker development environment
org.opencontainers.image.source=https://github.com/vectordotdev/vector/tree/master/scripts/environment/Dockerfile
org.opencontainers.image.title=Vector development environment
org.opencontainers.image.url=https://github.com/vectordotdev/vector
- name: Free disk space
shell: bash
run: sudo -E bash scripts/ci-free-disk-space.sh
- name: Build image (no push)
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
file: ./scripts/environment/Dockerfile
load: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Test built image
run: |
IMAGE_TAG=$(echo "${{ steps.meta.outputs.tags }}" | head -n1)
echo "Running build test inside container: ${IMAGE_TAG}"
docker run --rm \
-v "${GITHUB_WORKSPACE}:/src" \
-w /src \
"${IMAGE_TAG}" \
cargo run --bin vector -- --version
- name: Push image
if: env.SHOULD_PUBLISH == 'true'
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
file: ./scripts/environment/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}