Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/build-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build Check
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install
run: npm ci

- name: Build
run: npm run build
41 changes: 41 additions & 0 deletions .github/workflows/docker-build-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docker Build and Push to DockerHub (main)
env:
DOCKER_CLI_EXPERIMENTAL: enabled

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
name: Build and push graphmindset image
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- name: Check out from Git
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
id: buildx
- name: Cache Docker layers
uses: actions/cache@v4
id: cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Run Docker buildx
run: |
docker buildx build \
--cache-to "type=local,dest=/tmp/.buildx-cache" \
--platform linux/amd64 \
--tag "${{ secrets.DOCKER_HUB_USER }}/graphmindset:master" \
--output "type=registry" ./
77 changes: 77 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Docker Build and Push to DockerHub
env:
DOCKER_CLI_EXPERIMENTAL: enabled

on:
release:
types: [published]

jobs:
push:
strategy:
matrix:
include:
- platform: linux/amd64
runner: ubuntu-latest
- platform: linux/arm64
runner: ubuntu-arm64
runs-on: ${{ matrix.runner }}
name: Build and push graphmindset image
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
steps:
- name: Check out from Git
uses: actions/checkout@v4
- name: Set release tag
run: echo "RELEASE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
id: buildx
- name: Show available buildx platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Cache Docker layers
uses: actions/cache@v4
id: cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}-${{ matrix.platform }}
restore-keys: |
${{ runner.os }}-buildx-${{ matrix.platform }}-
- name: Run Docker buildx
run: |
PLATFORM_TAG=$(echo ${{ matrix.platform }} | tr '/' '-')
docker buildx build \
--platform ${{ matrix.platform }} \
--tag "${{ secrets.DOCKER_HUB_USER }}/graphmindset:${{ env.RELEASE_TAG }}-${PLATFORM_TAG}" \
--cache-from "type=registry,ref=${{ secrets.DOCKER_HUB_USER }}/graphmindset:cache-${PLATFORM_TAG}" \
--cache-to "type=registry,image-manifest=true,oci-mediatypes=true,mode=max,ref=${{ secrets.DOCKER_HUB_USER }}/graphmindset:cache-${PLATFORM_TAG}" \
--output "type=registry" ./

create-manifest:
runs-on: ubuntu-latest
needs: push
name: Create multi-platform manifest
steps:
- name: Check out from Git
uses: actions/checkout@v4
- name: Set release tag
run: echo "RELEASE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Create and push multi-platform manifest
run: |
docker buildx imagetools create \
--tag "${{ secrets.DOCKER_HUB_USER }}/graphmindset:${{ env.RELEASE_TAG }}" \
--tag "${{ secrets.DOCKER_HUB_USER }}/graphmindset:latest" \
"${{ secrets.DOCKER_HUB_USER }}/graphmindset:${{ env.RELEASE_TAG }}-linux-amd64" \
"${{ secrets.DOCKER_HUB_USER }}/graphmindset:${{ env.RELEASE_TAG }}-linux-arm64"
Loading