Added multi-arch support for Docker image (#5221)

* docker multi-arch support

* removed old workflow

* removed old login steps
This commit is contained in:
JustSKY 2022-06-17 07:44:42 +00:00 committed by GitHub
parent 30b5ea9c93
commit 026d042fe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,18 +1,37 @@
name: Release Docker Image name: Release Docker Image
on: on:
workflow_dispatch:
push: push:
branches: branches:
- master - master
- dev
jobs: jobs:
build: build:
name: build
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps: steps:
- uses: actions/checkout@v2 - name: Check out the repo
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with: with:
#ref: '70e4c2c0cb2f1c2f3d1c76de99a3e7593e3d7cae' username: ${{ secrets.DOCKERHUB_USERNAME }}
submodules: true password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build the Docker image - name: Build the Docker image
run: | run: |
docker login --username=${{ secrets.DOCKER_HUB_USER }} --password=${{ secrets.DOCKER_HUB_PWD }} docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v7 -t ${{ secrets.DOCKERHUB_USERNAME }}/siyuan:latest -t ${{ secrets.DOCKERHUB_USERNAME }}/siyuan:v2.0.20 .
docker build -t b3log/siyuan:latest -t b3log/siyuan:v2.0.20 .
docker push b3log/siyuan -a