https://dev.kronoz.win/r/marzneshin.git
1name: Package
2
3on:
4 push:
5 tags:
6 - 'v*.*.*'
7 workflow_dispatch:
8 inputs:
9 build-target:
10 description: 'Build Target (Release Type)'
11 type: choice
12 required: true
13 options:
14 - nightly
15 default: "nightly"
16 git-ref:
17 description: "Release Git Ref (Which branch or tag to build?)"
18 required: true
19 default: "master"
20
21 is-draft:
22 description: 'Draft Release? (Beta only, Nightly will always be a non-draft)'
23 type: boolean
24 required: true
25 default: true
26 is-pre-release:
27 description: 'Pre Release? (labeled as "PreRelease")'
28 type: boolean
29 required: true
30 default: true
31 schedule:
32 - cron: "0 3 * * *"
33
34jobs:
35 build-docker-image:
36 runs-on: ubuntu-latest
37 env:
38 VITE_BASE_API: /api/
39 steps:
40 - name: Checkout
41 uses: actions/checkout@v4
42 with:
43 fetch-depth: 0
44 ref: ${{ github.event.inputs.git-ref }}
45
46 - uses: pnpm/action-setup@v4
47 name: Install pnpm
48 with:
49 version: 9
50 run_install: false
51
52 - name: Use Node.js
53 uses: actions/setup-node@v4
54 with:
55 node-version: '20.x'
56
57 - name: Install dependencies
58 run: pnpm install
59 working-directory: ./dashboard/
60
61 - name: Build Dashboard
62 env:
63 VITE_LATEST_APP_VERSION: ${{ github.ref_name }}
64 run: npm run build --if-present -- --outDir 'dist' --assetsDir 'static'
65 working-directory: ./dashboard/
66
67 - name: Set up QEMU
68 uses: docker/setup-qemu-action@v3
69
70 - name: Set up Docker Buildx
71 uses: docker/setup-buildx-action@v3
72
73 - name: Login to Docker Hub
74 uses: docker/login-action@v3
75 with:
76 username: ${{ vars.DOCKERHUB_USERNAME }}
77 password: ${{ secrets.DOCKERHUB_TOKEN }}
78
79 - name: Build and push
80 if: ${{ github.event_name == 'push' }}
81 uses: docker/build-push-action@v5
82 with:
83 context: .
84 platforms: linux/amd64,linux/arm64
85 push: true
86 tags: |
87 dawsh/marzneshin:latest
88 dawsh/marzneshin:${{github.ref_name}}
89
90 - name: Nightly build and push for docker
91 if: ${{ github.event_name == 'schedule' || github.event.inputs.build-target == 'nightly'}}
92 uses: docker/build-push-action@v5
93 with:
94 context: .
95 platforms: linux/amd64,linux/arm64
96 push: true
97 tags: |
98 dawsh/marzneshin:nightly
99
100 - name: Update Nightly Release
101 if: ${{ github.event_name == 'schedule' || github.event.inputs.build-target == 'nightly'}}
102 uses: andelf/nightly-release@main
103 env:
104 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105 with:
106 tag_name: nightly
107 name: 'Marzneshin nightly release $$'
108 prerelease: true
109 draft: false
110 body: |
111 This is a nightly release of Marzneshin.
112 It's unstable compared to the official releases, **use it with caution**!