diff --git a/.github/workflows/build-dockerhub.yml b/.github/workflows/build-dockerhub.yml index abe0150..5b7c9bc 100644 --- a/.github/workflows/build-dockerhub.yml +++ b/.github/workflows/build-dockerhub.yml @@ -12,18 +12,20 @@ on: jobs: build: - runs-on: ${{ matrix.config.os }} + runs-on: ubuntu-latest strategy: matrix: config: - - { platform: linux-x64, os: ubuntu-latest, target: x86_64-unknown-linux-gnu } - - { platform: linux-arm64, os: ubuntu-latest, target: aarch64-unknown-linux-gnu } + - { platform: linux-x64, dist: "debian", target: x86_64-unknown-linux-gnu } + # - { platform: linux-arm64, dist: "debian", target: aarch64-unknown-linux-gnu } + # - { platform: linux-x64-alpine, target: x86_64-unknown-linux-musl } + # - { platform: linux-arm64-alpine, target: aarch64-unknown-linux-musl } environment: PROD env: CARGO_SERVER_SSL_CA: ${{ secrets.SERVER_SSL_CA }} CARGO_SERVER_SSL_CERT: ${{ secrets.SERVER_SSL_CERT }} CARGO_SERVER_SSL_KEY: ${{ secrets.SERVER_SSL_KEY }} - FILENAME: ${{ matrix.config.platform }} + FILENAME: ${{ matrix.config.dist}}-${{ matrix.config.platform }} steps: # Preparation Steps @@ -60,17 +62,19 @@ jobs: uses: actions/upload-artifact@v4 with: name: tagoio-relay-${{ env.FILENAME }} + retention-days: 1 path: target/${{ matrix.config.target }}/release/tagoio-relay push-to-dockerhub: needs: build - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: matrix: include: - - { platform: linux-x64, os: ubuntu-latest, architecture: linux/amd64 } - - { platform: linux-arm64, os: ubuntu-latest, architecture: linux/arm64/v8 } + - { dist: "debian", architecture: "linux/amd64,linux/arm64/v8" } + # - { platform: linux-x64-alpine, os: ubuntu-latest, architecture: linux/amd64 } + # - { platform: linux-arm64-alpine, os: ubuntu-latest, architecture: linux/arm64/v8 } steps: - name: Checkout code @@ -79,8 +83,8 @@ jobs: - name: Download build artifacts uses: actions/download-artifact@v4 with: - name: tagoio-relay-${{ matrix.platform }} path: build + pattern: debian-* - name: List files run: ls -la build @@ -92,26 +96,26 @@ jobs: exit 1 fi - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Cache Docker layers - uses: actions/cache@v4 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - # linux/arm64/v8,linux/amd64 - - name: Build and deploy images - run: bash dockerhub.sh ${{ matrix.architecture }} ${{ github.event.inputs.version || github.event.release.tag_name }} + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v3 + + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v3 + + # - name: Cache Docker layers + # uses: actions/cache@v4 + # with: + # path: /tmp/.buildx-cache + # key: ${{ runner.os }}-buildx-${{ github.sha }} + # restore-keys: | + # ${{ runner.os }}-buildx- + + # - name: Login to DockerHub + # uses: docker/login-action@v3 + # with: + # username: ${{ secrets.DOCKERHUB_USERNAME }} + # password: ${{ secrets.DOCKERHUB_TOKEN }} + + # # linux/arm64/v8,linux/amd64 + # - name: Build and deploy images + # run: bash dockerhub.sh ${{ matrix.architecture }} ${{ github.event.inputs.version || github.event.release.tag_name }}