2022-11-24 15:54:22 +03:00
|
|
|
name: build-and-push-test-image
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [main]
|
|
|
|
|
|
|
|
jobs:
|
2022-11-25 16:53:36 +03:00
|
|
|
build-and-push-test-image:
|
2022-11-24 15:54:22 +03:00
|
|
|
runs-on: ubuntu-latest
|
2023-04-09 11:32:27 +03:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: write
|
2022-11-24 15:54:22 +03:00
|
|
|
steps:
|
2023-10-03 11:58:47 +03:00
|
|
|
- uses: actions/checkout@v4
|
2022-11-24 15:54:22 +03:00
|
|
|
|
|
|
|
- name: Set up QEMU
|
2023-12-08 04:55:18 +03:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2022-11-24 15:54:22 +03:00
|
|
|
|
|
|
|
- name: Login to Docker Hub
|
2023-12-08 04:55:18 +03:00
|
|
|
uses: docker/login-action@v3
|
2022-11-24 15:54:22 +03:00
|
|
|
with:
|
|
|
|
username: neosmemo
|
|
|
|
password: ${{ secrets.DOCKER_NEOSMEMO_TOKEN }}
|
|
|
|
|
2023-04-09 11:32:27 +03:00
|
|
|
- name: Login to GitHub Container Registry
|
2023-12-08 04:55:18 +03:00
|
|
|
uses: docker/login-action@v3
|
2023-04-09 11:32:27 +03:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ github.token }}
|
|
|
|
|
2022-11-24 15:54:22 +03:00
|
|
|
- name: Set up Docker Buildx
|
|
|
|
id: buildx
|
2023-12-08 04:55:18 +03:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-11-24 15:54:22 +03:00
|
|
|
with:
|
|
|
|
install: true
|
2023-02-15 17:16:45 +03:00
|
|
|
version: v0.9.1
|
2022-11-24 15:54:22 +03:00
|
|
|
|
2023-04-09 11:32:27 +03:00
|
|
|
- name: Docker meta
|
|
|
|
id: meta
|
2023-12-08 04:55:18 +03:00
|
|
|
uses: docker/metadata-action@v5
|
2023-04-09 11:32:27 +03:00
|
|
|
with:
|
|
|
|
images: |
|
|
|
|
neosmemo/memos
|
|
|
|
ghcr.io/usememos/memos
|
|
|
|
flavor: |
|
|
|
|
latest=false
|
|
|
|
tags: |
|
|
|
|
type=raw,value=test
|
|
|
|
|
2022-11-25 17:08:43 +03:00
|
|
|
- name: Build and Push
|
2022-11-24 15:54:22 +03:00
|
|
|
id: docker_build
|
2023-12-08 04:55:18 +03:00
|
|
|
uses: docker/build-push-action@v5
|
2022-11-24 15:54:22 +03:00
|
|
|
with:
|
|
|
|
context: ./
|
|
|
|
file: ./Dockerfile
|
2023-09-18 19:08:58 +03:00
|
|
|
platforms: linux/amd64
|
2022-11-24 15:54:22 +03:00
|
|
|
push: true
|
2023-04-09 11:32:27 +03:00
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|