Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

chore: merge release action

Johnny33907539cdf4
diff --git a/.github/workflows/build-and-push-release-image.yml b/.github/workflows/build-and-push-release-image.yml
deleted file mode 100644
index 4ab012df9..000000000
--- a/.github/workflows/build-and-push-release-image.yml
+++ /dev/null
@@ -1,72 +0,0 @@
-name: Build and Push Release Image by Branch
-
-on:
- push:
- branches:
- # Run on pushing branches like 'release/1.0.0'.
- - "release/*"
-
-jobs:
- build-and-push-release-image:
- runs-on: ubuntu-latest
- permissions:
- contents: read
- packages: write
- steps:
- - uses: actions/checkout@v4
-
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v3
-
- - name: Extract build args
- # Extract version from tag name
- # Example: tag name `release/1.0.0` sets up env.VERSION=1.0.0
- run: |
- echo "VERSION=${GITHUB_REF_NAME#release/}" >> $GITHUB_ENV
-
- - name: Login to Docker Hub
- uses: docker/login-action@v3
- with:
- username: ${{ secrets.DOCKER_HUB_USERNAME }}
- password: ${{ secrets.DOCKER_HUB_TOKEN }}
-
- - name: Login to GitHub Container Registry
- uses: docker/login-action@v3
- with:
- registry: ghcr.io
- username: ${{ github.actor }}
- password: ${{ github.token }}
-
- - name: Set up Docker Buildx
- id: buildx
- uses: docker/setup-buildx-action@v3
- with:
- install: true
- version: v0.9.1
-
- - name: Docker meta
- id: meta
- uses: docker/metadata-action@v5
- with:
- images: |
- neosmemo/memos
- ghcr.io/usememos/memos
- tags: |
- type=semver,pattern={{version}},value=${{ env.VERSION }}
- type=semver,pattern={{major}}.{{minor}},value=${{ env.VERSION }}
- type=raw,value=stable
- flavor: |
- latest=false
- labels: |
- org.opencontainers.image.version=${{ env.VERSION }}
-
- - name: Build and Push
- id: docker_build
- uses: docker/build-push-action@v6
- with:
- context: .
- file: ./scripts/Dockerfile
- platforms: linux/amd64,linux/arm64
- push: true
- tags: ${{ steps.meta.outputs.tags }}
- labels: ${{ steps.meta.outputs.labels }}
diff --git a/.github/workflows/build-and-push-stable-image.yml b/.github/workflows/build-and-push-stable-image.yml
index db2018c0b..0302c29e6 100644
--- a/.github/workflows/build-and-push-stable-image.yml
+++ b/.github/workflows/build-and-push-stable-image.yml
@@ -1,13 +1,20 @@
-name: Build and Push Release Image by Tag
+name: Build and Push Stable Docker Image
on:
push:
+ branches:
+ - "release/**"
tags:
- # Match stable versions, such as 'v1.0.0'.
- "v*.*.*"
+env:
+ DOCKER_PLATFORMS: |
+ linux/amd64
+ linux/arm/v7
+ linux/arm64
+
jobs:
- build-and-push-stable-image:
+ build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
@@ -17,11 +24,24 @@ jobs:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
+ with:
+ platforms: ${{ env.DOCKER_PLATFORMS }}
- - name: Extract build args
- # Extract version number and check if it's an rc version
+ - name: Set up Docker Buildx
+ id: buildx
+ uses: docker/setup-buildx-action@v3
+ with:
+ version: latest
+ install: true
+ platforms: ${{ env.DOCKER_PLATFORMS }}
+
+ - name: Extract version
run: |
- echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
+ if [[ "$GITHUB_REF_TYPE" == "tag" ]]; then
+ echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
+ else
+ echo "VERSION=${GITHUB_REF_NAME#release/}" >> $GITHUB_ENV
+ fi
- name: Login to Docker Hub
uses: docker/login-action@v3
@@ -36,13 +56,6 @@ jobs:
username: ${{ github.actor }}
password: ${{ github.token }}
- - name: Set up Docker Buildx
- id: buildx
- uses: docker/setup-buildx-action@v3
- with:
- install: true
- version: v0.9.1
-
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
@@ -59,13 +72,28 @@ jobs:
labels: |
org.opencontainers.image.version=${{ env.VERSION }}
+ # Frontend build.
+ - uses: pnpm/[email protected]
+ with:
+ version: 10
+ - uses: actions/setup-node@v4
+ with:
+ node-version: "22"
+ cache: pnpm
+ cache-dependency-path: "web/pnpm-lock.yaml"
+ - run: pnpm install
+ working-directory: web
+ - name: Run frontend build
+ run: pnpm release
+ working-directory: web
+
- name: Build and Push
id: docker_build
uses: docker/build-push-action@v6
with:
context: .
file: ./scripts/Dockerfile
- platforms: linux/amd64,linux/arm64
+ platforms: ${{ env.DOCKER_PLATFORMS }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}