diff --git a/.github/workflows/build-and-push-release-image.yml b/.github/workflows/build-and-push-release-image.yml index f6bcec4c..ddcaaf82 100644 --- a/.github/workflows/build-and-push-release-image.yml +++ b/.github/workflows/build-and-push-release-image.yml @@ -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 }} diff --git a/.github/workflows/build-and-push-test-image.yml b/.github/workflows/build-and-push-test-image.yml index 889e6e9c..14efe630 100644 --- a/.github/workflows/build-and-push-test-image.yml +++ b/.github/workflows/build-and-push-test-image.yml @@ -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 }}