mirror of
https://github.com/wireadmin/wireadmin
synced 2025-06-26 18:28:06 +00:00
fix
This commit is contained in:
parent
66a1fe2ece
commit
3ad9bcb43f
23
.github/workflows/ci.yml
vendored
23
.github/workflows/ci.yml
vendored
@ -10,6 +10,11 @@ concurrency:
|
|||||||
group: '${{ github.workflow }}-${{ github.event.number || github.sha }}'
|
group: '${{ github.workflow }}-${{ github.event.number || github.sha }}'
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
env:
|
||||||
|
BUILD_PLATFORMS: linux/amd64,linux/arm64
|
||||||
|
GHCR_SLUG: ghcr.io/wireadmin/wireadmin
|
||||||
|
TAG: dev
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -24,25 +29,29 @@ jobs:
|
|||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- run: pnpm -r install --frozen-lockfile
|
- run: pnpm -r install --frozen-lockfile
|
||||||
- run: pnpm --if-present format:check
|
- run: pnpm format:check
|
||||||
- run: pnpm --if-present lint
|
|
||||||
|
|
||||||
image:
|
image:
|
||||||
|
if: github.repository == 'wireadmin/wireadmin'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: docker/setup-buildx-action@v3
|
- uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v1
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.PRIVATE_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build image
|
- name: Build & Publish
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
push: false
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
platforms: "${{ env.BUILD_PLATFORMS }}"
|
||||||
|
tags: "${{ env.GHCR_SLUG }}:${{ env.TAG }}"
|
||||||
|
75
.github/workflows/docker-image.yaml
vendored
75
.github/workflows/docker-image.yaml
vendored
@ -1,75 +0,0 @@
|
|||||||
name: Build Prerelease Image
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
tag:
|
|
||||||
description: 'Tag to build'
|
|
||||||
required: true
|
|
||||||
|
|
||||||
##
|
|
||||||
# Invoke:
|
|
||||||
# gh workflow run "Build Prerelease Image" -f tag=2.0.0-canary.0
|
|
||||||
##
|
|
||||||
|
|
||||||
env:
|
|
||||||
IMAGE_TAG: ${{ github.event.inputs.tag }}
|
|
||||||
BUILD_PLATFORMS: linux/amd64,linux/arm64
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
ghcr-build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
env:
|
|
||||||
IMAGE_NAME: shahradelahi/wireadmin
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.repository_owner }}
|
|
||||||
password: ${{ secrets.PRIVATE_TOKEN }}
|
|
||||||
|
|
||||||
- name: Push to GitHub Container Registry
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./Dockerfile
|
|
||||||
push: true
|
|
||||||
args: VERSION=${{ env.IMAGE_TAG }}
|
|
||||||
tags: ghcr.io/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
|
|
||||||
|
|
||||||
docker-build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
env:
|
|
||||||
IMAGE_NAME: litehex/wireadmin
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Login to DockerHub
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
|
||||||
registry: docker.io
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Push to DockerHub
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./Dockerfile
|
|
||||||
push: true
|
|
||||||
platforms: ${{ env.BUILD_PLATFORMS }}
|
|
||||||
args: VERSION=${{ env.IMAGE_TAG }}
|
|
||||||
tags: docker.io/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
|
|
116
.github/workflows/release.yaml
vendored
116
.github/workflows/release.yaml
vendored
@ -1,87 +1,89 @@
|
|||||||
name: Release Package
|
name: Release Package
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
push:
|
||||||
inputs:
|
branches:
|
||||||
tag:
|
- canary
|
||||||
description: 'Tag to build'
|
|
||||||
required: true
|
concurrency: "${{ github.workflow }}-${{ github.ref }}"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
BUILD_PLATFORMS: linux/amd64,linux/arm64
|
GHCR_SLUG: ghcr.io/wireadmin/wireadmin
|
||||||
IMAGE_TAG: ${{ github.event.inputs.tag }}
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
needs: [github-registry, docker-hub]
|
if: github.repository == 'wireadmin/wireadmin'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
published: ${{ steps.changesets.outputs.published }}
|
||||||
|
publishedPackages: ${{ steps.changesets.outputs.publishedPackages }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v4
|
||||||
uses: actions/checkout@v3
|
- uses: pnpm/action-setup@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
version: 8
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 18
|
||||||
|
cache: "pnpm"
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: pnpm install
|
||||||
|
|
||||||
- name: Create Release Pull Request or Publish
|
- name: Create Release Pull Request or Publish
|
||||||
id: changesets
|
id: changesets
|
||||||
uses: changesets/action@v1
|
uses: changesets/action@v1
|
||||||
with:
|
with:
|
||||||
commit: 'chore(release): version package'
|
commit: "chore(release): version package"
|
||||||
title: 'chore(release): version package'
|
title: "chore(release): version package"
|
||||||
publish: changeset publish
|
publish: pnpm ci:publish
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.PRIVATE_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
github-registry:
|
build:
|
||||||
name: Push to GitHub Container Registry
|
name: Build & Publish
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
needs: release
|
||||||
IMAGE_NAME: shahradelahi/wireadmin
|
if: needs.release.outputs.published == 'true'
|
||||||
|
strategy:
|
||||||
|
fail-fast: true
|
||||||
|
matrix:
|
||||||
|
package: ${{ fromJson(needs.release.outputs.publishedPackages) }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: docker/setup-buildx-action@v3
|
- uses: docker/setup-buildx-action@v3
|
||||||
|
- uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.PRIVATE_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Push to GitHub Container Registry
|
- name: Docker meta
|
||||||
uses: docker/build-push-action@v5
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
images: |
|
||||||
file: ./Dockerfile
|
${{ env.DOCKERHUB_SLUG }}
|
||||||
|
${{ env.GHCR_SLUG }}
|
||||||
|
tags: |
|
||||||
|
type=semver,pattern={{version}},value=${{ matrix.package.version }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/bake-action@v4
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
./docker-bake.hcl
|
||||||
|
${{ steps.meta.outputs.bake-file }}
|
||||||
|
targets: image-all
|
||||||
push: true
|
push: true
|
||||||
platforms: ${{ env.BUILD_PLATFORMS }}
|
|
||||||
args: VERSION=${{ env.IMAGE_TAG }}
|
|
||||||
tags: ghcr.io/${{ env.IMAGE_NAME }}:latest,ghcr.io/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
|
|
||||||
|
|
||||||
docker-hub:
|
- name: Check manifest
|
||||||
name: Push to DockerHub
|
run: docker buildx imagetools inspect ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }}
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
IMAGE_NAME: litehex/wireadmin
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Inspect image
|
||||||
uses: docker/login-action@v1
|
run: |
|
||||||
with:
|
docker pull ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }}
|
||||||
registry: docker.io
|
docker image inspect ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }}
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Push to DockerHub
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./Dockerfile
|
|
||||||
push: true
|
|
||||||
platforms: ${{ env.BUILD_PLATFORMS }}
|
|
||||||
args: VERSION=${{ env.IMAGE_TAG }}
|
|
||||||
tags: docker.io/${{ env.IMAGE_NAME }}:latest,docker.io/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user