mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: support multi platforms docker image (#103)
This commit is contained in:
@@ -9,10 +9,13 @@ jobs:
|
|||||||
build-and-push-dev-image:
|
build-and-push-dev-image:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: neosmemo
|
username: neosmemo
|
||||||
password: ${{ secrets.DOCKER_NEOSMEMO_TOKEN }}
|
password: ${{ secrets.DOCKER_NEOSMEMO_TOKEN }}
|
||||||
@@ -20,6 +23,8 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
with:
|
||||||
|
install: true
|
||||||
|
|
||||||
- name: Build and Push
|
- name: Build and Push
|
||||||
id: docker_build
|
id: docker_build
|
||||||
|
@@ -10,7 +10,10 @@ jobs:
|
|||||||
build-and-push-release-image:
|
build-and-push-release-image:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
- name: Extract build args
|
- name: Extract build args
|
||||||
# Extract version from branch name
|
# Extract version from branch name
|
||||||
@@ -19,7 +22,7 @@ jobs:
|
|||||||
echo "VERSION=${GITHUB_REF_NAME#release/v}" >> $GITHUB_ENV
|
echo "VERSION=${GITHUB_REF_NAME#release/v}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: neosmemo
|
username: neosmemo
|
||||||
password: ${{ secrets.DOCKER_NEOSMEMO_TOKEN }}
|
password: ${{ secrets.DOCKER_NEOSMEMO_TOKEN }}
|
||||||
@@ -27,6 +30,8 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
with:
|
||||||
|
install: true
|
||||||
|
|
||||||
- name: Build and Push
|
- name: Build and Push
|
||||||
id: docker_build
|
id: docker_build
|
||||||
|
10
.github/workflows/build-and-push-test-image.yml
vendored
10
.github/workflows/build-and-push-test-image.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: build-and-push-dev-image
|
name: build-and-push-test-image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -9,13 +9,13 @@ jobs:
|
|||||||
build-and-push-dev-image:
|
build-and-push-dev-image:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: neosmemo
|
username: neosmemo
|
||||||
password: ${{ secrets.DOCKER_NEOSMEMO_TOKEN }}
|
password: ${{ secrets.DOCKER_NEOSMEMO_TOKEN }}
|
||||||
@@ -34,4 +34,4 @@ jobs:
|
|||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: neosmemo/memos:dev
|
tags: neosmemo/memos:test
|
||||||
|
@@ -8,7 +8,7 @@ RUN yarn
|
|||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
||||||
# Build backend exec file.
|
# Build backend exec file.
|
||||||
FROM golang:1.18.3-bullseye AS backend
|
FROM golang:1.18.3-alpine3.16 AS backend
|
||||||
WORKDIR /backend-build
|
WORKDIR /backend-build
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
Reference in New Issue
Block a user