diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f9e76c..5b825e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 6 + dotnet-version: 8 - name: Restore dependencies run: dotnet restore - name: Build diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 254990f..dd21701 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -5,93 +5,38 @@ on: branches: [ "master" ] jobs: - build_amd64: - name: Build and Push Docker Image (amd64) + build_multiarch: + name: Build and Push Docker Image (arm64 and amd64) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Login to Docker Hub - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: + registry: git.ivanch.me username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_ACCESS_TOKEN }} - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Available platforms run: echo ${{ steps.buildx.outputs.platforms }} - name: Build Docker image and push id: docker_build - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: ./ file: ./Dockerfile push: true - tags: ${{ secrets.DOCKER_USERNAME }}/kasbot:latest - platforms: linux/amd64 + tags: git.ivanch.me/ivanch/kasbot/kasbot:latest + platforms: linux/arm64,linux/amd64 - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} - - build_arm64: - name: Build and Push Docker Image (arm64) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Login to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_ACCESS_TOKEN }} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - - - name: Available platforms - run: echo ${{ steps.buildx.outputs.platforms }} - - - name: Build Docker image and push - id: docker_build - uses: docker/build-push-action@v2 - with: - context: ./ - file: ./Dockerfile - push: true - tags: ${{ secrets.DOCKER_USERNAME }}/kasbot:latest - platforms: linux/arm64 - - - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} - - - deploy: - name: Update running container - runs-on: ubuntu-latest - needs: build_arm64 - - steps: - - name: Recreate container - uses: appleboy/ssh-action@v0.1.7 - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.KEY }} - port: ${{ secrets.PORT }} - script: | - cd docker/kasbot - docker-compose down - docker-compose rm - docker-compose pull - docker-compose up -d