diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5da39c69c3c4e077874b29add148b4453188ef0..13ad49a0ac609fe30beeae2850fc31b760538823 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,21 +1,17 @@ name: ci on: + workflow_dispatch: push: branches: - 'releases/v*' - 'develop' tags: - 'v*.*.*' - workflow_dispatch: - jobs: docker: - strategy: - matrix: - platform: ["linux/amd64","linux/arm64/v8"] - runs-on: [self-hosted, "${{ matrix.platform }}"] + runs-on: [self-hosted, multiarch] steps: - name: Checkout uses: actions/checkout@v3 @@ -33,26 +29,44 @@ jobs: type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} + labels: | + org.opencontainers.image.description=A test for Docker CI with Github Actions. - name: Login to DockerHub if: github.event_name != 'pull_request' uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - #- name: Set up QEMU - # uses: docker/setup-qemu-action@v2 + - uses: webfactory/ssh-agent@v0.7.0 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - with: - driver: docker -# driver: docker-container -# driver-opts: | -# network=host + with: + driver-opts: | + network=host + buildkitd-flags: | + --debug + --allow-insecure-entitlement network.host + --allow-insecure-entitlement security.insecure + endpoint: ssh://bruno@pc-bruno-gpu + platforms: linux/amd64 + append: | + - endpoint: ssh://bruno@mbp-bruno + platforms: linux/arm64/v8 - name: Build and push uses: docker/build-push-action@v4 with: context: . - # platforms: ${{ matrix.platform }} + platforms: | + linux/amd64 + linux/arm64/v8 push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + - name: Update repo description + uses: peter-evans/dockerhub-description@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: "${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPOSITORY_NAME }}"