110 lines
3.1 KiB
YAML
110 lines
3.1 KiB
YAML
name: Build and Push Docker Images
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-push-bun:
|
|
name: Build and Push Bun Image
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ github.token }}
|
|
|
|
- name: Extract Docker metadata (Bun)
|
|
id: meta-bun
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ghcr.io/dcodesdev/letterspace
|
|
tags: |
|
|
type=ref,event=tag
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=semver,pattern={{major}}
|
|
type=raw,value=latest,enable=${{ !contains(github.ref, '-') }}
|
|
type=raw,value=bun,enable=${{ !contains(github.ref, '-') }}
|
|
|
|
- name: Build and push Docker image (Bun)
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: ${{ steps.meta-bun.outputs.tags }}
|
|
# platforms: linux/amd64,linux/arm64
|
|
cache-from: type=gha,scope=bun
|
|
cache-to: type=gha,mode=max,scope=bun
|
|
|
|
build-and-push-node:
|
|
name: Build and Push Node Image
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ github.token }}
|
|
|
|
- name: Extract Docker metadata (Node)
|
|
id: meta-node
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ghcr.io/dcodesdev/letterspace
|
|
tags: |
|
|
type=ref,event=tag,suffix=-node
|
|
type=semver,pattern={{version}}-node
|
|
type=semver,pattern={{major}}.{{minor}}-node
|
|
type=semver,pattern={{major}}-node
|
|
type=raw,value=latest-node,enable=${{ !contains(github.ref, '-') }}
|
|
type=raw,value=node,enable=${{ !contains(github.ref, '-') }}
|
|
type=raw,value=latest,enable=false
|
|
|
|
- name: Build and push Docker image (Node)
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile.node
|
|
push: true
|
|
tags: ${{ steps.meta-node.outputs.tags }}
|
|
# platforms: linux/amd64,linux/arm64
|
|
cache-from: type=gha,scope=node
|
|
cache-to: type=gha,mode=max,scope=node
|
|
|
|
release:
|
|
name: Create GitHub Release
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
needs: [build-and-push-bun, build-and-push-node]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
body_path: RELEASE_NOTES.md
|