mirror of
https://github.com/wireadmin/wireadmin
synced 2025-04-25 08:36:48 +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 }}'
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
BUILD_PLATFORMS: linux/amd64,linux/arm64
|
||||
GHCR_SLUG: ghcr.io/wireadmin/wireadmin
|
||||
TAG: dev
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
@ -24,25 +29,29 @@ jobs:
|
||||
cache: 'pnpm'
|
||||
|
||||
- run: pnpm -r install --frozen-lockfile
|
||||
- run: pnpm --if-present format:check
|
||||
- run: pnpm --if-present lint
|
||||
- run: pnpm format:check
|
||||
|
||||
image:
|
||||
if: github.repository == 'wireadmin/wireadmin'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v1
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.PRIVATE_TOKEN }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build image
|
||||
- name: Build & Publish
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
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
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Tag to build'
|
||||
required: true
|
||||
push:
|
||||
branches:
|
||||
- canary
|
||||
|
||||
concurrency: "${{ github.workflow }}-${{ github.ref }}"
|
||||
|
||||
env:
|
||||
BUILD_PLATFORMS: linux/amd64,linux/arm64
|
||||
IMAGE_TAG: ${{ github.event.inputs.tag }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
GHCR_SLUG: ghcr.io/wireadmin/wireadmin
|
||||
|
||||
jobs:
|
||||
release:
|
||||
needs: [github-registry, docker-hub]
|
||||
if: github.repository == 'wireadmin/wireadmin'
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
published: ${{ steps.changesets.outputs.published }}
|
||||
publishedPackages: ${{ steps.changesets.outputs.publishedPackages }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v2
|
||||
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
|
||||
id: changesets
|
||||
uses: changesets/action@v1
|
||||
with:
|
||||
commit: 'chore(release): version package'
|
||||
title: 'chore(release): version package'
|
||||
publish: changeset publish
|
||||
commit: "chore(release): version package"
|
||||
title: "chore(release): version package"
|
||||
publish: pnpm ci:publish
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PRIVATE_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
github-registry:
|
||||
name: Push to GitHub Container Registry
|
||||
build:
|
||||
name: Build & Publish
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
IMAGE_NAME: shahradelahi/wireadmin
|
||||
needs: release
|
||||
if: needs.release.outputs.published == 'true'
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
package: ${{ fromJson(needs.release.outputs.publishedPackages) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.PRIVATE_TOKEN }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Push to GitHub Container Registry
|
||||
uses: docker/build-push-action@v5
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
images: |
|
||||
${{ 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
|
||||
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: Push to DockerHub
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
IMAGE_NAME: litehex/wireadmin
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- name: Check manifest
|
||||
run: docker buildx imagetools inspect ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }}
|
||||
|
||||
- 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 }}:latest,docker.io/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
|
||||
- name: Inspect image
|
||||
run: |
|
||||
docker pull ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }}
|
||||
docker image inspect ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }}
|
||||
|
Loading…
Reference in New Issue
Block a user