Skip to content

Publish to ghcr.io #7

Publish to ghcr.io

Publish to ghcr.io #7

Workflow file for this run

name: Publish to ghcr.io
env:
IMAGE_NAME: dockge
on:
release:
types: [released]
workflow_dispatch:
jobs:
build-and-publish-image:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 22
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Lint
run: pnpm run lint
- name: Check Typescript
run: pnpm run check-ts
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build and publish base image
run: docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t ghcr.io/tobi1449/dockge:base -f ./docker/Base.Dockerfile . --push
- name: Build and publish health-check
run: docker buildx build -f docker/BuildHealthCheck.Dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t ghcr.io/tobi1449/dockge:build-healthcheck . --push
- name: Build and publish main docker image
run: node ./extra/env2arg.js docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t ghcr.io/tobi1449/dockge:latest -t ghcr.io/tobi1449/dockge:$VERSION --target release -f ./docker/Dockerfile . --push