Minor improvements #285
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: main-pipeline | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| quality-checks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - uses: actions/setup-go@v4 | |
| with: | |
| go-version: 1.24.3 | |
| - name: npm cache download | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ${{ github.workspace }}/frontend/node_modules | |
| key: npm-cache | |
| - name: go cache download | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ${{ github.workspace }}/.go | |
| key: go-cache | |
| - name: Prettier | |
| working-directory: frontend | |
| run: | | |
| npm install && \ | |
| npx prettier --check src | |
| - name: Eslint | |
| working-directory: frontend | |
| run: | | |
| npm install && \ | |
| npx eslint src | |
| - name: Sonarqube | |
| uses: SonarSource/sonarqube-scan-action@v4.2.1 | |
| env: | |
| GOPATH: ${{ github.workspace }}/.go | |
| GOMODCACHE: ${{ github.workspace }}/.go/pkg/mod | |
| GOTOOLCHAIN: "" | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - uses: actions/setup-go@v4 | |
| with: | |
| go-version: 1.24.3 | |
| - uses: docker/setup-qemu-action@v3 | |
| - uses: docker/setup-buildx-action@v3 | |
| with: | |
| driver: docker-container | |
| driver-opts: | | |
| image=moby/buildkit:master | |
| network=host | |
| platforms: linux/amd64,linux/arm64 | |
| - uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: npm cache download | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ${{ github.workspace }}/frontend/node_modules | |
| key: npm-cache | |
| - name: go cache download | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ${{ github.workspace }}/.go | |
| key: go-cache | |
| - name: Frontend build | |
| working-directory: frontend | |
| run: | | |
| npm install && \ | |
| npm run build | |
| - name: Backend build | |
| env: | |
| GOPATH: ${{ github.workspace }}/.go | |
| GOMODCACHE: ${{ github.workspace }}/.go/pkg/mod | |
| GOTOOLCHAIN: "" | |
| GOOS: linux | |
| CGO_ENABLED: "0" | |
| run: | | |
| go work sync && \ | |
| GOARCH=amd64 go build -o build/linux/amd64 application/main.go && \ | |
| GOARCH=arm64 go build -o build/linux/arm64 application/main.go | |
| - name: Build and push Docker images | |
| run: | | |
| docker buildx build \ | |
| --tag dillmann/nginx-ignition:snapshot \ | |
| --platform linux/amd64,linux/arm64 \ | |
| --push . | |
| - name: npm cache upload | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: ${{ github.workspace }}/frontend/node_modules | |
| key: npm-cache | |
| - name: go cache upload | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: ${{ github.workspace }}/.go | |
| key: go-cache |