|
| 1 | +name: Docker build and publish |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: [published] |
| 6 | + |
| 7 | +jobs: |
| 8 | + build-amd64: |
| 9 | + name: Build and publish amd64 image |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v2 |
| 13 | + - name: Get version |
| 14 | + env: |
| 15 | + TAG_NAME: ${{ github.event.release.tag_name }} |
| 16 | + run: echo "VERSION=${TAG_NAME#v}" >> $GITHUB_ENV |
| 17 | + - name: Patch files |
| 18 | + uses: onlyutkarsh/patch-files-action@v1.0.1 |
| 19 | + with: |
| 20 | + files: | |
| 21 | + lovelace-kindle-screensaver/config.json |
| 22 | + patch-syntax: | |
| 23 | + = /version => "${{ env.VERSION }}" |
| 24 | + - name: publish amd64 docker files |
| 25 | + if: github.event_name != 'pull_request' |
| 26 | + run: docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v ~/.docker:/root/.docker -v "$(pwd)":/data homeassistant/amd64-builder -t lovelace-kindle-screensaver --amd64 --release-tag --docker-user marciogranzotto --docker-password ${{ secrets.DOCKER_PASSWORD }} |
| 27 | + build-armv7: |
| 28 | + name: Build and publish armv7 image |
| 29 | + runs-on: ubuntu-latest |
| 30 | + steps: |
| 31 | + - uses: actions/checkout@v2 |
| 32 | + - name: Get version |
| 33 | + env: |
| 34 | + TAG_NAME: ${{ github.event.release.tag_name }} |
| 35 | + run: echo "VERSION=${TAG_NAME#v}" >> $GITHUB_ENV |
| 36 | + - name: Patch files |
| 37 | + uses: onlyutkarsh/patch-files-action@v1.0.1 |
| 38 | + with: |
| 39 | + files: | |
| 40 | + lovelace-kindle-screensaver/config.json |
| 41 | + patch-syntax: | |
| 42 | + = /version => "${{ env.VERSION }}" |
| 43 | + - name: publish armv7 docker files |
| 44 | + if: github.event_name != 'pull_request' |
| 45 | + run: docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v ~/.docker:/root/.docker -v "$(pwd)":/data homeassistant/amd64-builder -t lovelace-kindle-screensaver --armv7 --release-tag --docker-user marciogranzotto --docker-password ${{ secrets.DOCKER_PASSWORD }} |
| 46 | + build-aarch64: |
| 47 | + name: Build and publish aarch64 image |
| 48 | + runs-on: ubuntu-latest |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v2 |
| 51 | + - name: Get version |
| 52 | + env: |
| 53 | + TAG_NAME: ${{ github.event.release.tag_name }} |
| 54 | + run: echo "VERSION=${TAG_NAME#v}" >> $GITHUB_ENV |
| 55 | + - name: Patch files |
| 56 | + uses: onlyutkarsh/patch-files-action@v1.0.1 |
| 57 | + with: |
| 58 | + files: | |
| 59 | + lovelace-kindle-screensaver/config.json |
| 60 | + patch-syntax: | |
| 61 | + = /version => "${{ env.VERSION }}" |
| 62 | +
|
| 63 | + - name: publish aarch64 docker files |
| 64 | + if: github.event_name != 'pull_request' |
| 65 | + run: docker run --rm --privileged -v /var/run/docker.sock:/var/run/docker.sock -v ~/.docker:/root/.docker -v "$(pwd)":/data homeassistant/amd64-builder -t lovelace-kindle-screensaver --aarch64 --release-tag --docker-user marciogranzotto --docker-password ${{ secrets.DOCKER_PASSWORD }} |
| 66 | + update-main-repo: |
| 67 | + needs: [build-amd64, build-armv7, build-aarch64, build-i386, build-armhf] |
| 68 | + name: Update addons repository |
| 69 | + runs-on: ubuntu-latest |
| 70 | + container: |
| 71 | + image: hassioaddons/repository-updater:latest |
| 72 | + steps: |
| 73 | + - name: upload |
| 74 | + run: repository-updater --token ${{ secrets.GIT_TOKEN }} --repository marciogranzotto/addons-repository --addon lovelace-kindle-screensaver |
0 commit comments