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 run: npm run build --if-present -- --outDir 'dist' --assetsDir 'static'
63 working-directory: ./dashboard/
64
65 - name: Set up QEMU
66 uses: docker/setup-qemu-action@v3
67
68 - name: Set up Docker Buildx
69 uses: docker/setup-buildx-action@v3
70
71 - name: Login to Docker Hub
72 uses: docker/login-action@v3
73 with:
74 username: ${{ vars.DOCKERHUB_USERNAME }}
75 password: ${{ secrets.DOCKERHUB_TOKEN }}
76
77 - name: Build and push
78 if: ${{ github.event_name == 'push' }}
79 uses: docker/build-push-action@v5
80 with:
81 context: .
82 platforms: linux/amd64,linux/arm64
83 push: true
84 tags: |
85 dawsh/marzneshin:latest
86 dawsh/marzneshin:${{github.ref_name}}
87
88 - name: Nightly build and push for docker
89 if: ${{ github.event_name == 'schedule' || github.event.inputs.build-target == 'nightly'}}
90 uses: docker/build-push-action@v5
91 with:
92 context: .
93 platforms: linux/amd64,linux/arm64
94 push: true
95 tags: |
96 dawsh/marzneshin:nightly
97
98 - name: Update Nightly Release
99 if: ${{ github.event_name == 'schedule' || github.event.inputs.build-target == 'nightly'}}
100 uses: andelf/nightly-release@main
101 env:
102 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103 with:
104 tag_name: nightly
105 name: 'Marzneshin nightly release $$'
106 prerelease: true
107 draft: false
108 body: |
109 This is a nightly release of Marzneshin.
110 It's unstable compared to the official releases, **use it with caution**!