mirror of
https://github.com/ajnart/homarr.git
synced 2026-01-29 18:59:20 +01:00
100 lines
3.0 KiB
YAML
100 lines
3.0 KiB
YAML
name: "[Deployment] Release"
|
|
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- closed
|
|
branches:
|
|
- main
|
|
workflow_dispatch: {}
|
|
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
|
|
env:
|
|
CI: true
|
|
REGISTRY: ghcr.io
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
TURBO_TELEMETRY_DISABLED: 1
|
|
|
|
concurrency: production
|
|
|
|
jobs:
|
|
deploy:
|
|
name: Deploy docker image
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node-version: [20]
|
|
steps:
|
|
- name: Discord notification
|
|
env:
|
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
|
uses: Ilshidur/action-discord@master
|
|
with:
|
|
args: "Deployment of an image has been triggered: [run ${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
|
|
- uses: actions/checkout@v4
|
|
- name: Get Next Version
|
|
id: semver
|
|
uses: ietf-tools/semver-action@v1
|
|
with:
|
|
token: ${{ github.token }}
|
|
branch: dev
|
|
- name: Discord notification
|
|
env:
|
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
|
uses: Ilshidur/action-discord@master
|
|
with:
|
|
args: "Semver computed next tag to be ${{ steps.semver.outputs.next }}. Current is ${{ steps.semver.outputs.current }}"
|
|
- uses: pnpm/action-setup@v2
|
|
with:
|
|
version: 8
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
cache: "pnpm"
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
- name: Build artifacts
|
|
run: pnpm build
|
|
- name: Discord notification
|
|
env:
|
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
|
uses: Ilshidur/action-discord@master
|
|
with:
|
|
args: "Built application artifacts. Building images..."
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Docker meta
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
|
|
tags: |
|
|
type=raw,value=latest
|
|
type=raw,value=${{ steps.semver.outputs.next }}
|
|
- name: Build and push
|
|
id: buildPushAction
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
|
context: .
|
|
push: false
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
network: host
|
|
env:
|
|
CI: true
|
|
- name: Discord notification
|
|
env:
|
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
|
uses: Ilshidur/action-discord@master
|
|
with:
|
|
args: "Deployment of image has completed. Image ID is '${{ steps.buildPushAction.outputs.imageid }}'. This was a dry run."
|