gitscope
← marzneshin / v0.3.0-alpha2 / .github/workflows/package.yml
https://dev.kronoz.win/r/marzneshin.git
.github/workflows/package.yml · YAML
Blame Raw
 1name: Package
 2
 3on:
 4  push:
 5    tags:
 6      - 'v*.*.*'
 7
 8jobs:
 9  build-docker-image:
10    runs-on: ubuntu-latest
11    env: 
12      VITE_BASE_API: /api/
13    steps:
14      - name: Checkout
15        uses: actions/checkout@v4
16        
17      - uses: pnpm/action-setup@v3
18        name: Install pnpm
19        with:
20          version: 8
21          run_install: false
22        
23      - name: Use Node.js 
24        uses: actions/setup-node@v4
25        with:
26          node-version: '20.x'
27
28      - name: Install dependencies
29        run: pnpm install
30        working-directory: ./dashboard/
31    
32      - name: Build Dashboard
33        run: npm run build -- --outDir dist --base '/dashboard/'
34        working-directory: ./dashboard/
35      
36      - name: Set up QEMU
37        uses: docker/setup-qemu-action@v3
38
39      - name: Set up Docker Buildx
40        uses: docker/setup-buildx-action@v3
41  
42      - name: Login to Docker Hub
43        uses: docker/login-action@v3
44        with:
45          username: ${{ vars.DOCKERHUB_USERNAME }}
46          password: ${{ secrets.DOCKERHUB_TOKEN }}
47
48      - name: Build and push
49        uses: docker/build-push-action@v5
50        with:
51          context: .
52          platforms: linux/amd64,linux/arm64
53          push: true
54          tags: |
55            dawsh/marzneshin:latest
56            dawsh/marzneshin:${{github.ref_name}}