gitscope
← marzneshin / v0.1.4 / .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      - name: Use Node.js 
18        uses: actions/setup-node@v4
19        with:
20          node-version: '20.x'
21          cache: 'npm'
22          cache-dependency-path: 'app/dashboard/package-lock.json'
23  
24      - name: Install dependencies
25        run: npm install
26        working-directory: ./app/dashboard/
27    
28      - name: Build Dashboard
29        run: npm run build --if-present -- --outDir dist --base '/dashboard/'
30        working-directory: ./app/dashboard/
31      
32      - name: Set up QEMU
33        uses: docker/setup-qemu-action@v3
34
35      - name: Set up Docker Buildx
36        uses: docker/setup-buildx-action@v3
37  
38      - name: Login to Docker Hub
39        uses: docker/login-action@v3
40        with:
41          username: ${{ vars.DOCKERHUB_USERNAME }}
42          password: ${{ secrets.DOCKERHUB_TOKEN }}
43
44      - name: Build and push
45        uses: docker/build-push-action@v5
46        with:
47          context: .
48          platforms: linux/amd64,linux/arm64
49          push: true
50          tags: |
51            dawsh/marzneshin:latest
52            dawsh/marzneshin:${{github.ref_name}}