diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2640d7f..4543c7b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,19 +6,15 @@ on: schedule: - cron: '0 0 * * 0' jobs: - supported-arch-matrix: - name: Supported processor architectures + supported-platform-matrix: + name: Supported processor platforms runs-on: ubuntu-latest - needs: - - lint-dockerfile outputs: - arch: ${{ steps.supported-arch-matrix.outputs.arch }} + platform: ${{ steps.supported-platform-matrix.outputs.platform }} steps: - - uses: actions/checkout@v4 - - id: supported-arch-matrix - name: Generate Arch - run: | - echo "arch=[\"linux/amd64\",\"linux/arm64\"]" >> $GITHUB_OUTPUT + - id: supported-platform-matrix + name: Generate platform + uses: WyriHaximus/github-action-oci-image-supported-platforms@main lint-dockerfile: name: Lint Dockerfile runs-on: ubuntu-latest @@ -34,9 +30,9 @@ jobs: strategy: fail-fast: false matrix: - platform: ${{ fromJson(needs.supported-arch-matrix.outputs.arch) }} + platform: ${{ fromJson(needs.supported-platform-matrix.outputs.platform) }} needs: - - supported-arch-matrix + - supported-platform-matrix - lint-dockerfile runs-on: ubuntu-latest steps: @@ -66,9 +62,9 @@ jobs: strategy: fail-fast: false matrix: - platform: ${{ fromJson(needs.supported-arch-matrix.outputs.arch) }} + platform: ${{ fromJson(needs.supported-platform-matrix.outputs.platform) }} needs: - - supported-arch-matrix + - supported-platform-matrix - build-docker-image runs-on: ubuntu-latest steps: @@ -87,12 +83,12 @@ jobs: tests: name: Test ${{ matrix.platform }} needs: - - supported-arch-matrix + - supported-platform-matrix - scan-vulnerability strategy: fail-fast: false matrix: - platform: ${{ fromJson(needs.supported-arch-matrix.outputs.arch) }} + platform: ${{ fromJson(needs.supported-platform-matrix.outputs.platform) }} runs-on: ubuntu-latest steps: - name: Prepare @@ -113,7 +109,7 @@ jobs: if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main' name: Push needs: - - supported-arch-matrix + - supported-platform-matrix - tests runs-on: ubuntu-latest services: @@ -146,7 +142,7 @@ jobs: - run: rm -Rf /tmp/docker-image/ - run: docker images - run: | - archs=${{ join(fromJson(needs.supported-arch-matrix.outputs.arch), ',') }} + archs=${{ join(fromJson(needs.supported-platform-matrix.outputs.platform), ',') }} for arch in ${archs//,/ } do docker tag "${{ env.DOCKER_IMAGE }}:${arch//\//-}" "localhost:5000/${{ env.DOCKER_IMAGE }}:${arch//\//-}" @@ -172,4 +168,4 @@ jobs: context: . file: docker-file-${{ matrix.registry }}-wyrihaximusnet-github-action-runner tags: ghcr.io/${{ env.DOCKER_IMAGE }}:latest,ghcr.io/${{ env.DOCKER_IMAGE }}:${{ steps.time.outputs.time }} - platforms: ${{ join(fromJson(needs.supported-arch-matrix.outputs.arch), ',') }} + platforms: ${{ join(fromJson(needs.supported-platform-matrix.outputs.platform), ',') }}