Skip to content

chore: add nemo

chore: add nemo #31

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Build & Publish Containers
on:
workflow_dispatch:
push:
branches:
- next
# pull_request:
release:
types:
- created
env:
USER: njfamirm
jobs:
build:
if: github.repository_owner == 'njfamirm'
name: Build & Publish Containers
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: speech-to-text-app
permissions:
contents: read
packages: write
id-token: write
steps:
- name: ⤵️ Checkout repository
uses: actions/checkout@v4.1.1
- name: 🏗 Install cosign
uses: sigstore/cosign-installer@v3.4.0
- name: 🏗 Setup Docker Buildx
uses: docker/setup-buildx-action@v3.1.0
- name: 🏗 Cache Docker Layers
uses: actions/cache@v4.0.0
with:
path: /tmp/.buildx-cache
key: container/${{ matrix.name }}
- name: 🏗 Log into ghcr.io registry
uses: docker/login-action@v3.0.0
with:
registry: ghcr.io
username: ${{env.USER}}
password: ${{secrets.GITHUB_TOKEN}}
- name: 🏗 Extract metadata
id: meta
uses: docker/metadata-action@v5.5.1
with:
github-token: ${{secrets.GITHUB_TOKEN}}
images: |
name=ghcr.io/${{env.USER}}/${{matrix.name}},enable=true
name=docker.io/${{env.USER}}/${{matrix.name}},enable=false
tags: |
type=semver,enable=true,pattern={{major}}
type=semver,enable=true,pattern={{major}}.{{minor}}
type=semver,enable=true,pattern={{version}}
type=ref,enable=true,event=branch
labels: |
org.opencontainers.image.title="njfamirm/${{matrix.name}}"
org.opencontainers.image.vendor="njfamirm"
org.opencontainers.image.documentation="https://github.com/njfamirm/text-to-speech"
org.opencontainers.image.authors="S. Amir Mohammad Najafi <njfamirm@gmail.com> (https://www.njfamirm.ir)"
- name: 🚀 Build and push container image
id: build_and_push
uses: docker/build-push-action@v5.1.0
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache