mirror of
https://github.com/wireadmin/wireadmin
synced 2025-01-23 12:27:00 +00:00
67 lines
1.7 KiB
YAML
67 lines
1.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- canary
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: '${{ github.workflow }}-${{ github.event.number || github.sha }}'
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
BUILD_PLATFORMS: linux/amd64,linux/arm64
|
|
DOCKERHUB_SLUG: shahradel/wireadmin
|
|
GHCR_SLUG: ghcr.io/wireadmin/wireadmin
|
|
TAG: dev
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: pnpm/action-setup@v2
|
|
with:
|
|
version: 8
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: 'pnpm'
|
|
|
|
- run: pnpm -r install --frozen-lockfile
|
|
- run: pnpm format:check
|
|
|
|
image:
|
|
if: github.repository == 'wireadmin/wireadmin'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to DockerHub
|
|
if: github.event_name != 'pull_request'
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Login to GitHub Container Registry
|
|
if: github.event_name != 'pull_request'
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build & Publish
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
context: .
|
|
file: ./Dockerfile
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
platforms: '${{ env.BUILD_PLATFORMS }}'
|
|
tags: '${{ env.GHCR_SLUG }}:${{ env.TAG }},${{ env.DOCKERHUB_SLUG }}:${{ env.TAG }}'
|