Skip to content

2024-02-06 12:13:55 #22

2024-02-06 12:13:55

2024-02-06 12:13:55 #22

Workflow file for this run

name: release
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
install: true
- name: Get the latest commit SHA
id: commit_sha
run: echo "::set-output name=SHA_SHORT::$(echo $GITHUB_SHA | cut -c 1-7)"
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
registry: registry.cn-hongkong.aliyuncs.com
username: 944473232@qq.com
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
# 截取 sha 前七位
tags: registry.cn-hongkong.aliyuncs.com/jakee/blog-hk:${{ steps.commit_sha.outputs.SHA_SHORT }},registry.cn-hongkong.aliyuncs.com/jakee/blog-hk:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache