|
11 | 11 | # Then a new version will be deployed on the self-hosted runner. |
12 | 12 |
|
13 | 13 | jobs: |
14 | | - rpi4: |
| 14 | + build: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + steps: |
| 17 | + - name: Checkout code |
| 18 | + uses: actions/checkout@v4 |
| 19 | + |
| 20 | + - name: Set up Docker Buildx |
| 21 | + uses: docker/setup-buildx-action@v3 |
| 22 | + |
| 23 | + - name: Build ARM64 image |
| 24 | + uses: docker/build-push-action@v5 |
| 25 | + with: |
| 26 | + context: . |
| 27 | + file: ./HomeSpeaker.Server2/Dockerfile |
| 28 | + platforms: linux/arm64 |
| 29 | + tags: homespeakerserver2:latest |
| 30 | + outputs: type=docker,dest=/tmp/homespeaker-arm64.tar |
| 31 | + cache-from: type=gha |
| 32 | + cache-to: type=gha,mode=max |
| 33 | + |
| 34 | + - name: Upload image artifact |
| 35 | + uses: actions/upload-artifact@v4 |
| 36 | + with: |
| 37 | + name: homespeaker-arm64-image |
| 38 | + path: /tmp/homespeaker-arm64.tar |
| 39 | + retention-days: 1 |
| 40 | + |
| 41 | + deploy: |
| 42 | + needs: build |
15 | 43 | runs-on: [self-hosted, "${{ matrix.runner}}" ] |
16 | 44 | strategy: |
17 | 45 | matrix: |
18 | 46 | runner: [rpi4, rpi42] |
19 | 47 |
|
20 | 48 | steps: |
21 | | - - uses: actions/checkout@v3 |
22 | | - |
23 | | - - name: Docker compose pull |
24 | | - run: docker-compose pull |
25 | | - |
| 49 | + - name: Checkout code |
| 50 | + uses: actions/checkout@v4 |
| 51 | + |
| 52 | + - name: Download image artifact |
| 53 | + uses: actions/download-artifact@v4 |
| 54 | + with: |
| 55 | + name: homespeaker-arm64-image |
| 56 | + path: /tmp/ |
| 57 | + |
| 58 | + - name: Load Docker image |
| 59 | + run: docker load < /tmp/homespeaker-arm64.tar |
| 60 | + |
26 | 61 | - name: Docker compose down |
27 | 62 | run: docker-compose down |
28 | 63 |
|
29 | 64 | - name: Docker compose up |
30 | 65 | env: |
31 | | - COMPOSE_DOCKER_CLI_BUILD: 1 |
32 | | - DOCKER_BUILDKIT: 1 |
33 | 66 | GOVEE_API_KEY: ${{ secrets.GOVEE_API_KEY }} |
34 | | - run: docker-compose up -d --build --remove-orphans |
| 67 | + run: docker-compose up -d --remove-orphans |
35 | 68 |
|
0 commit comments