feat(ci): Add GHCR mirror and major/minor rolling tags (#1503)

This commit is contained in:
Gabe Cook 2023-04-09 03:32:27 -05:00 committed by GitHub
parent ef7381f032
commit c6e1d139f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 48 additions and 2 deletions

View File

@ -9,6 +9,9 @@ on:
jobs:
build-and-push-release-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
@ -27,6 +30,13 @@ jobs:
username: neosmemo
password: ${{ secrets.DOCKER_NEOSMEMO_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
@ -34,6 +44,18 @@ jobs:
install: true
version: v0.9.1
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
neosmemo/memos
ghcr.io/usememos/memos
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and Push
id: docker_build
uses: docker/build-push-action@v3
@ -42,4 +64,5 @@ jobs:
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: neosmemo/memos:latest, neosmemo/memos:${{ env.VERSION }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@ -7,6 +7,9 @@ on:
jobs:
build-and-push-test-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
@ -19,6 +22,13 @@ jobs:
username: neosmemo
password: ${{ secrets.DOCKER_NEOSMEMO_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
@ -26,6 +36,18 @@ jobs:
install: true
version: v0.9.1
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
neosmemo/memos
ghcr.io/usememos/memos
flavor: |
latest=false
tags: |
type=raw,value=test
- name: Build and Push
id: docker_build
uses: docker/build-push-action@v3
@ -34,4 +56,5 @@ jobs:
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: neosmemo/memos:test
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}