mirror of
https://github.com/wireadmin/wireadmin
synced 2025-06-26 18:28:06 +00:00
update release
ci
This commit is contained in:
parent
239e268663
commit
f8841726aa
@ -1,23 +1,44 @@
|
|||||||
name: Build Docker Image
|
name: Release Package
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
workflow_dispatch:
|
||||||
types: [created]
|
inputs:
|
||||||
|
tag:
|
||||||
|
description: 'Tag to build'
|
||||||
|
required: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
BUILD_PLATFORMS: linux/amd64,linux/arm64
|
BUILD_PLATFORMS: linux/amd64,linux/arm64
|
||||||
|
IMAGE_TAG: ${{ github.event.inputs.tag }}
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ghcr-build:
|
release:
|
||||||
|
needs: [ github-registry, docker-hub ]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- 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
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.PRIVATE_TOKEN }}
|
||||||
|
|
||||||
|
github-registry:
|
||||||
|
name: Push to GitHub Container Registry
|
||||||
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
IMAGE_NAME: shahradelahi/wireadmin
|
IMAGE_NAME: shahradelahi/wireadmin
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: docker/setup-buildx-action@v3
|
- uses: docker/setup-buildx-action@v3
|
||||||
@ -29,10 +50,6 @@ jobs:
|
|||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.PRIVATE_TOKEN }}
|
password: ${{ secrets.PRIVATE_TOKEN }}
|
||||||
|
|
||||||
- run: |
|
|
||||||
echo "Labeling image with TAG: ${GITHUB_REF#refs/tags/v}"
|
|
||||||
echo "IMAGE_TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Push to GitHub Container Registry
|
- name: Push to GitHub Container Registry
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
@ -40,17 +57,14 @@ jobs:
|
|||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
push: true
|
push: true
|
||||||
platforms: ${{ env.BUILD_PLATFORMS }}
|
platforms: ${{ env.BUILD_PLATFORMS }}
|
||||||
|
args: VERSION=${{ env.IMAGE_TAG }}
|
||||||
tags: ghcr.io/${{ env.IMAGE_NAME }}:latest,ghcr.io/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
|
tags: ghcr.io/${{ env.IMAGE_NAME }}:latest,ghcr.io/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
|
||||||
|
|
||||||
docker-build:
|
docker-hub:
|
||||||
|
name: Push to DockerHub
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
IMAGE_NAME: litehex/wireadmin
|
IMAGE_NAME: litehex/wireadmin
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: docker/setup-buildx-action@v3
|
- uses: docker/setup-buildx-action@v3
|
||||||
@ -62,10 +76,6 @@ jobs:
|
|||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- run: |
|
|
||||||
echo "Labeling image with TAG: ${GITHUB_REF#refs/tags/v}"
|
|
||||||
echo "IMAGE_TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Push to DockerHub
|
- name: Push to DockerHub
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
@ -73,4 +83,5 @@ jobs:
|
|||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
push: true
|
push: true
|
||||||
platforms: ${{ env.BUILD_PLATFORMS }}
|
platforms: ${{ env.BUILD_PLATFORMS }}
|
||||||
|
args: VERSION=${{ env.IMAGE_TAG }}
|
||||||
tags: docker.io/${{ env.IMAGE_NAME }}:latest,docker.io/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
|
tags: docker.io/${{ env.IMAGE_NAME }}:latest,docker.io/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
|
@ -1,5 +1,6 @@
|
|||||||
ARG ALPINE_VERSION=3.19
|
ARG ALPINE_VERSION=3.19
|
||||||
ARG NODE_VERSION=20
|
ARG NODE_VERSION=20
|
||||||
|
ARG VERSION=0.0.0-canary
|
||||||
|
|
||||||
FROM --platform=$BUILDPLATFORM chriswayg/tor-alpine:latest as tor
|
FROM --platform=$BUILDPLATFORM chriswayg/tor-alpine:latest as tor
|
||||||
|
|
||||||
@ -87,7 +88,6 @@ HEALTHCHECK --interval=60s --timeout=3s --start-period=20s --retries=3 \
|
|||||||
VOLUME ["/etc/torrc.d", "/data", "/var/vlogs"]
|
VOLUME ["/etc/torrc.d", "/data", "/var/vlogs"]
|
||||||
|
|
||||||
# Overwrite package version
|
# Overwrite package version
|
||||||
ARG VERSION=0.0.0-canary
|
|
||||||
RUN node -e "const fs = require('fs'); const pkg = JSON.parse(fs.readFileSync('/app/package.json')); pkg.version = process.env.VERSION; fs.writeFileSync('/app/package.json', JSON.stringify(pkg, null, 2));"
|
RUN node -e "const fs = require('fs'); const pkg = JSON.parse(fs.readFileSync('/app/package.json')); pkg.version = process.env.VERSION; fs.writeFileSync('/app/package.json', JSON.stringify(pkg, null, 2));"
|
||||||
|
|
||||||
# Run the app
|
# Run the app
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
ARG ALPINE_VERSION=3.19
|
ARG ALPINE_VERSION=3.19
|
||||||
ARG NODE_VERSION=20
|
ARG NODE_VERSION=20
|
||||||
|
ARG VERSION=0.0.0-dev
|
||||||
|
|
||||||
FROM --platform=$BUILDPLATFORM chriswayg/tor-alpine:latest as tor
|
FROM --platform=$BUILDPLATFORM chriswayg/tor-alpine:latest as tor
|
||||||
|
|
||||||
@ -44,7 +45,6 @@ ENV HOST_HEADER=x-forwarded-host
|
|||||||
|
|
||||||
FROM base AS runner
|
FROM base AS runner
|
||||||
|
|
||||||
ENV VERSION=0.0.0-dev
|
|
||||||
ENV NODE_ENV=development
|
ENV NODE_ENV=development
|
||||||
ENV LOG_LEVEL=debug
|
ENV LOG_LEVEL=debug
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user