Telegram Channel
优化了一下 github action

设置 commit 的 7 位短 hash 作为 docker image tag:
- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-7`" >> $GITHUB_ENV


将 docker layers 在 github action cache 里缓存:
-
name: Build and push hash label
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: YOUR_IMAGE_NAME:${{ env.SHORT_SHA }}
cache-from: type=gha
cache-to: type=gha,mode=max
 
 
Telegram Channel