6
6
- r[0-9]+ # Trigger builds after a push to weekly branches
7
7
pull_request :
8
8
9
+ permissions :
10
+ contents : read
11
+
9
12
concurrency :
10
13
# Cancel any running workflow for the same branch when new commits are pushed.
11
14
# We group both by ref_name (available when CI is triggered by a push to a branch/tag)
18
21
runs-on : ubuntu-latest
19
22
steps :
20
23
- name : Checkout code
21
- uses : actions/checkout@v4
24
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
25
+ with :
26
+ persist-credentials : false
22
27
- name : Install Go
23
- uses : actions/setup-go@v5
28
+ uses : actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
24
29
with :
25
30
go-version : 1.23.8
26
31
- name : Format
29
34
runs-on : ubuntu-latest
30
35
steps :
31
36
- name : Checkout code
32
- uses : actions/checkout@v4
37
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
38
+ with :
39
+ persist-credentials : false
33
40
- name : Install Go
34
- uses : actions/setup-go@v5
41
+ uses : actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
35
42
with :
36
43
go-version : 1.23.8
37
44
- name : Check generated files
47
54
runs-on : ${{ matrix.runner }}
48
55
steps :
49
56
- name : Checkout code
50
- uses : actions/checkout@v4
57
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
58
+ with :
59
+ persist-credentials : false
51
60
- name : Install Go
52
- uses : actions/setup-go@v5
61
+ uses : actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
53
62
with :
54
63
go-version : 1.23.8
55
64
- name : Go Mod
60
69
runs-on : ubuntu-latest
61
70
steps :
62
71
- name : Checkout code
63
- uses : actions/checkout@v4
72
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
73
+ with :
74
+ persist-credentials : false
64
75
- name : Install Go
65
- uses : actions/setup-go@v5
76
+ uses : actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
66
77
with :
67
78
go-version : 1.23.8
68
79
- name : Run linter
74
85
runs-on : ubuntu-latest
75
86
steps :
76
87
- name : " Check out code"
77
- uses : " actions/checkout@v4"
88
+ uses : " actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" # v4
89
+ with :
90
+ persist-credentials : false
78
91
- name : " Test docs"
79
92
run : make docs/test
80
93
@@ -83,16 +96,18 @@ jobs:
83
96
runs-on : ubuntu-latest
84
97
steps :
85
98
- name : Checkout Repo
86
- uses : actions/checkout@v4
99
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
100
+ with :
101
+ persist-credentials : false
87
102
- name : Set up QEMU
88
- uses : docker/setup-qemu-action@v2
103
+ uses : docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
89
104
- name : Set up Docker Buildx
90
- uses : docker/setup-buildx-action@v2
105
+ uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
91
106
- name : Set up go
92
- uses : actions/setup-go@v5
107
+ uses : actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
93
108
with :
94
109
go-version : 1.23.8
95
- - uses : actions/setup-node@v3
110
+ - uses : actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3
96
111
with :
97
112
node-version : 20
98
113
cache : yarn
@@ -104,42 +119,23 @@ jobs:
104
119
runs-on : ubuntu-latest
105
120
steps :
106
121
- name : Checkout Repo
107
- uses : actions/checkout@v4
122
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
123
+ with :
124
+ persist-credentials : false
108
125
- name : Set up QEMU
109
- uses : docker/setup-qemu-action@v2
126
+ uses : docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
110
127
- name : Set up Docker Buildx
111
- uses : docker/setup-buildx-action@v2
128
+ uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
112
129
- name : Set up go
113
- uses : actions/setup-go@v5
130
+ uses : actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
114
131
with :
115
132
go-version : 1.23.8
116
133
- name : Login to Docker Hub
117
- uses : docker/login-action@v2
134
+ uses : docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
118
135
with :
119
136
username : ${{ secrets.DOCKERHUB_USERNAME }}
120
137
password : ${{ secrets.DOCKERHUB_TOKEN }}
121
138
- name : Pyroscope Build & push multi-arch image
122
139
id : build-push
123
140
run : |
124
141
make docker-image/pyroscope/push-multiarch "BUILDX_ARGS=--cache-from=type=gha --cache-to=type=gha"
125
-
126
- deploy-dev-001 :
127
- if : github.event_name == 'push' && github.repository == 'grafana/pyroscope' && github.ref == 'refs/heads/main'
128
- runs-on : ubuntu-latest
129
- needs : [build-push]
130
- steps :
131
- - name : Checkout Repo
132
- uses : actions/checkout@v4
133
- - name : Get github app token (valid for an hour)
134
- id : app-release
135
- uses : tibdex/github-app-token@v1
136
- with :
137
- app_id : ${{ secrets.APP_ID }}
138
- private_key : ${{ secrets.APP_PRIVATE_KEY }}
139
- repository : grafana/deployment_tools
140
- - name : Deploy to fire-dev-001
141
- run : |
142
- git config --global url."https://x-access-token:$(echo "${GITHUB_TOKEN}" | xargs)@github.com/grafana/deployment_tools".insteadOf "https://github.com/grafana/deployment_tools"
143
- make docker-image/pyroscope/deploy-dev-001
144
- env :
145
- GITHUB_TOKEN : ${{ steps.app-release.outputs.token }}
0 commit comments