Skip to content
This repository has been archived by the owner on Feb 3, 2025. It is now read-only.

docs: update README.md #74

docs: update README.md

docs: update README.md #74

on:
push:
branches:
- main
name: release-please
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- uses: pnpm/action-setup@v2.2.4
name: Install pnpm
id: pnpm-install
with:
version: latest
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build
release-please:
outputs:
release_major: ${{ steps.release.outputs.major }}
release_minor: ${{ steps.release.outputs.minor }}
release_patch: ${{ steps.release.outputs.patch }}
release_created: ${{ steps.release.outputs.release_created }}
needs: check
runs-on: ubuntu-latest
steps:
- name: Release
uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: node
command: manifest
build-and-push:
needs: release-please
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
if: ${{ needs.release-please.outputs.release_created }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
if: ${{ needs.release-please.outputs.release_created }}
- name: Set up Docker Build
uses: docker/setup-buildx-action@v2
if: ${{ needs.release-please.outputs.release_created }}
- name: Login to Github Packages
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
if: ${{ needs.release-please.outputs.release_created }}
- name: Login to Docker hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
if: ${{ needs.release-please.outputs.release_created }}
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
if: ${{ needs.release-please.outputs.release_created }}
- name: Build
uses: docker/build-push-action@v4
with:
context: .
file: docker/Dockerfile
push: ${{ needs.release-please.outputs.release_created }}
platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/kaizoku:latest
${{ secrets.DOCKERHUB_USERNAME }}/kaizoku:v${{ needs.release-please.outputs.release_major }}
${{ secrets.DOCKERHUB_USERNAME }}/kaizoku:v${{ needs.release-please.outputs.release_major }}.${{ needs.release-please.outputs.release_minor }}
${{ secrets.DOCKERHUB_USERNAME }}/kaizoku:v${{ needs.release-please.outputs.release_major }}.${{ needs.release-please.outputs.release_minor }}.${{ needs.release-please.outputs.release_patch }}
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:v${{ needs.release-please.outputs.release_major }}
ghcr.io/${{ github.repository }}:v${{ needs.release-please.outputs.release_major }}.${{ needs.release-please.outputs.release_minor }}
ghcr.io/${{ github.repository }}:v${{ needs.release-please.outputs.release_major }}.${{ needs.release-please.outputs.release_minor }}.${{ needs.release-please.outputs.release_patch }}
if: ${{ needs.release-please.outputs.release_created }}
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
if: ${{ needs.release-please.outputs.release_created }}