@@ -99,32 +99,15 @@ jobs:
99
99
repo-token : ${{ secrets.GITHUB_TOKEN }}
100
100
- uses : actions-rust-lang/setup-rust-toolchain@v1
101
101
with :
102
- toolchain : nightly
102
+ toolchain : nightly-2024-06-14
103
103
components : rustfmt
104
104
cache : true
105
- - run : just fmt
106
-
107
- build :
108
- if : ${{ github.event_name == 'pull_request' }}
109
- name : Build
110
- runs-on : ubuntu-latest
111
- steps :
112
- - uses : actions/checkout@v4
113
- - uses : taiki-e/install-action@just
114
- - uses : rui314/setup-mold@v1
115
- - uses : heliaxdev/setup-protoc@v2
116
- with :
117
- version : " 25.0"
118
- repo-token : ${{ secrets.GITHUB_TOKEN }}
119
- - uses : actions-rust-lang/setup-rust-toolchain@v1
120
- with :
121
- cache : true
122
- - run : just build
105
+ - run : just fmt-check
123
106
124
107
docker :
125
108
name : Docker
126
109
runs-on : ubuntu-latest
127
- if : ${{ github.event_name == 'merge_group' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/1.0.0-maint ' }}
110
+ if : ${{ github.event_name == 'merge_group' || github.event_name == 'pull_request ' }}
128
111
env :
129
112
GIT_LFS_SKIP_SMUDGE : 1
130
113
REGISTRY_URL : ghcr.io
@@ -149,6 +132,18 @@ jobs:
149
132
uses : actions/checkout@v4
150
133
- name : Set up Docker Buildx
151
134
uses : docker/setup-buildx-action@v3
135
+ - name : Docker meta
136
+ id : meta
137
+ uses : docker/metadata-action@v5
138
+ with :
139
+ images : ${{ env.REGISTRY_URL }}/anoma/namada-indexer
140
+ flavor : |
141
+ latest=auto
142
+ prefix=${{ matrix.docker.image }}
143
+ suffix=
144
+ tags : |
145
+ type=ref,event=branch,prefix=${{ matrix.docker.image }}-branch-
146
+ type=ref,event=pr,prefix=${{ matrix.docker.image }}-pr-
152
147
- name : Login to GHCR
153
148
uses : docker/login-action@v3
154
149
with :
@@ -161,15 +156,15 @@ jobs:
161
156
with :
162
157
context : .
163
158
file : Dockerfile
164
- build-args : PACKAGE=${{matrix.docker.package}}
165
- push : ${{ github.ref == 'refs/heads/main ' }}
166
- tags : ${{ env.REGISTRY_URL }}/anoma/namada-indexer:${{ matrix.docker.image }}-main
159
+ build-args : PACKAGE=${{ matrix.docker.package }}
160
+ push : ${{ github.event.pull_request.head.repo.full_name == 'anoma/namada-indexer ' }}
161
+ tags : ${{ steps.meta.outputs.tags }}
167
162
labels : ${{ steps.meta.outputs.labels }}
168
163
cache-from : type=gha
169
164
cache-to : type=gha,mode=max
170
165
171
166
can_enqueue :
172
- needs : [clippy, format, build , validate-swagger]
167
+ needs : [clippy, format, docker , validate-swagger]
173
168
if : always() && github.event_name != 'merge_group'
174
169
permissions :
175
170
actions : read
@@ -199,5 +194,4 @@ jobs:
199
194
run : |
200
195
echo "ALL_SUCCESS=$(echo "$NEEDS_JSON" | jq '. | to_entries | map([.value.result == "success", .value.result == "skipped"] | any) | all')" >> $GITHUB_ENV
201
196
- name : check outcomes
202
- run : " [ $ALL_SUCCESS == true ]"
203
-
197
+ run : " [ $ALL_SUCCESS == true ]"
0 commit comments