Make devices.json easier to read locally #901
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: Build and Deploy | |
| on: | |
| push: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build and lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: '20' | |
| - uses: nrwl/nx-set-shas@v2 | |
| - run: npm i | |
| - run: npx nx affected --target=build --parallel=3 | |
| - run: npx nx affected --target=lint --parallel=3 | |
| - run: npx nx affected --target=test --parallel=3 | |
| sonarcloud: | |
| name: SonarCloud | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: '20' | |
| - name: SonarCloud Scan | |
| uses: SonarSource/sonarcloud-github-action@master | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| SONARQUBE_SCANNER_PARAMS: >- | |
| { | |
| "sonar.c.file.suffixes": "-", | |
| "sonar.cpp.file.suffixes": "-", | |
| "sonar.objc.file.suffixes": "-" | |
| } | |
| deploy: | |
| runs-on: ubuntu-latest | |
| name: Docker Deploy | |
| needs: build | |
| if: github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install GitVersion | |
| uses: gittools/actions/gitversion/setup@v0 | |
| with: | |
| versionSpec: '5.x' | |
| - name: Determine Version | |
| id: gitversion | |
| uses: gittools/actions/gitversion/execute@v0 | |
| with: | |
| useConfigFile: true | |
| - name: Display GitVersion variables (with prefix) | |
| run: | | |
| echo "Major: ${{ env.GitVersion_Major }}" | |
| echo "Minor: ${{ env.GitVersion_Minor }}" | |
| echo "Patch: ${{ env.GitVersion_Patch }}" | |
| echo "PreReleaseTag: ${{ env.GitVersion_PreReleaseTag }}" | |
| echo "PreReleaseTagWithDash: ${{ env.GitVersion_PreReleaseTagWithDash }}" | |
| echo "PreReleaseLabel: ${{ env.GitVersion_PreReleaseLabel }}" | |
| echo "PreReleaseNumber: ${{ env.GitVersion_PreReleaseNumber }}" | |
| echo "WeightedPreReleaseNumber: ${{ env.GitVersion_WeightedPreReleaseNumber }}" | |
| echo "BuildMetaData: ${{ env.GitVersion_BuildMetaData }}" | |
| echo "BuildMetaDataPadded: ${{ env.GitVersion_BuildMetaDataPadded }}" | |
| echo "FullBuildMetaData: ${{ env.GitVersion_FullBuildMetaData }}" | |
| echo "MajorMinorPatch: ${{ env.GitVersion_MajorMinorPatch }}" | |
| echo "SemVer: ${{ env.GitVersion_SemVer }}" | |
| echo "LegacySemVer: ${{ env.GitVersion_LegacySemVer }}" | |
| echo "LegacySemVerPadded: ${{ env.GitVersion_LegacySemVerPadded }}" | |
| echo "AssemblySemVer: ${{ env.GitVersion_AssemblySemVer }}" | |
| echo "AssemblySemFileVer: ${{ env.GitVersion_AssemblySemFileVer }}" | |
| echo "FullSemVer: ${{ env.GitVersion_FullSemVer }}" | |
| echo "InformationalVersion: ${{ env.GitVersion_InformationalVersion }}" | |
| echo "BranchName: ${{ env.GitVersion_BranchName }}" | |
| echo "EscapedBranchName: ${{ env.GitVersion_EscapedBranchName }}" | |
| echo "Sha: ${{ env.GitVersion_Sha }}" | |
| echo "ShortSha: ${{ env.GitVersion_ShortSha }}" | |
| echo "NuGetVersionV2: ${{ env.GitVersion_NuGetVersionV2 }}" | |
| echo "NuGetVersion: ${{ env.GitVersion_NuGetVersion }}" | |
| echo "NuGetPreReleaseTagV2: ${{ env.GitVersion_NuGetPreReleaseTagV2 }}" | |
| echo "NuGetPreReleaseTag: ${{ env.GitVersion_NuGetPreReleaseTag }}" | |
| echo "VersionSourceSha: ${{ env.GitVersion_VersionSourceSha }}" | |
| echo "CommitsSinceVersionSource: ${{ env.GitVersion_CommitsSinceVersionSource }}" | |
| echo "CommitsSinceVersionSourcePadded: ${{ env.GitVersion_CommitsSinceVersionSourcePadded }}" | |
| echo "UncommittedChanges: ${{ env.GitVersion_UncommittedChanges }}" | |
| echo "CommitDate: ${{ env.GitVersion_CommitDate }}" | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.USERNAME }} | |
| password: ${{ secrets.TOKEN }} | |
| # Add support for more platforms with QEMU (optional) | |
| # https://github.com/docker/setup-qemu-action | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v2 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Create custom buildx builder | |
| run: docker buildx create --name mybuilder | |
| - name: Use the created builder | |
| run: docker buildx use mybuilder | |
| - name: Bootstrap builder | |
| run: docker buildx inspect --bootstrap | |
| - name: Build and push base image | |
| run: docker buildx build --platform=linux/arm64/v8,linux/amd64 -t ${{ secrets.USERNAME }}/angulon:nx-base -t ${{secrets.USERNAME}}/angulon:nx-base-${{env.GitVersion_SemVer}} --push . | |
| - name: Build and push API image | |
| run: docker buildx build --platform=linux/arm64/v8,linux/amd64 -f ./apps/api/Dockerfile -t ${{ secrets.USERNAME }}/angulon:api -t ${{secrets.USERNAME}}/angulon:api-${{env.GitVersion_SemVer}} --push . | |
| - name: Build and push Website image | |
| run: docker buildx build --platform=linux/arm64/v8,linux/amd64 -f ./apps/website/Dockerfile -t ${{ secrets.USERNAME }}/angulon:website -t ${{secrets.USERNAME}}/angulon:website-${{env.GitVersion_SemVer}} --push . | |
| - uses: dkershner6/post-api-call-action@v2 | |
| name: Update Portainer Stack | |
| with: | |
| url: ${{ secrets.PORTAINER_WEBHOOK_URL }} |