Update README.md #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: docker-ci | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-deploy-image: | |
runs-on: ubuntu-latest | |
steps: | |
# 拉取master分支 | |
- name: Checkout | |
uses: actions/checkout@master | |
# 设置qemu来编译多个平台的镜像 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
# 设置buildx | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
# 配置缓存加快编译速度 | |
- name: Cache Docker layers | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
# 登陆dockerhub | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
# 编译并且推送到dockerhub | |
- name: Build and push | |
uses: docker/build-push-action@v2 | |
with: | |
push: true | |
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache | |
tags: | | |
raydoom/v2ray-ws-docker:latest | |
raydoom/v2ray-ws-docker:${{ github.sha }} |