|
@@ -1,10 +1,10 @@
|
|
|
name: Build AdGuardHome
|
|
|
|
|
|
on:
|
|
|
- # UTC +8 [https://crontab.guru/]
|
|
|
- # schedule:
|
|
|
- # - cron: "0 20 15,30 * *"
|
|
|
workflow_dispatch:
|
|
|
+ release:
|
|
|
+ types: [published]
|
|
|
+ repositories: [AdguardTeam/AdGuardHome]
|
|
|
|
|
|
jobs:
|
|
|
build-adguardhome:
|
|
@@ -20,15 +20,9 @@ jobs:
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
- id: buildx
|
|
|
-
|
|
|
- - name: Cache Docker layers
|
|
|
- uses: actions/cache@v4
|
|
|
with:
|
|
|
- path: /tmp/.buildx-cache
|
|
|
- key: ${{ runner.os }}-buildx-${{ github.sha }}
|
|
|
- restore-keys: |
|
|
|
- ${{ runner.os }}-buildx-
|
|
|
+ driver-opts: |
|
|
|
+ network=host
|
|
|
|
|
|
- name: Login to Docker Hub
|
|
|
uses: docker/login-action@v3
|
|
@@ -36,7 +30,7 @@ jobs:
|
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
|
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
|
|
|
|
|
- - name: Login to GitHub Container Registry
|
|
|
+ - name: Login to GHCR
|
|
|
uses: docker/login-action@v3
|
|
|
with:
|
|
|
registry: ghcr.io
|
|
@@ -45,7 +39,6 @@ jobs:
|
|
|
|
|
|
- name: Build and push Docker images
|
|
|
uses: docker/build-push-action@v5
|
|
|
- id: docker_build_adguardhome
|
|
|
with:
|
|
|
context: ./adguardhome
|
|
|
file: ./adguardhome/Dockerfile.latest
|
|
@@ -55,15 +48,5 @@ jobs:
|
|
|
${{ secrets.DOCKER_HUB_USERNAME }}/adguardhome:${{ env.ADGUARDHOME_VERSION }}
|
|
|
ghcr.io/${{ github.repository }}/adguardhome:latest
|
|
|
ghcr.io/${{ github.repository }}/adguardhome:${{ env.ADGUARDHOME_VERSION }}
|
|
|
- builder: ${{ steps.buildx.outputs.name }}
|
|
|
- cache-from: type=local,src=/tmp/.buildx-cache
|
|
|
- cache-to: type=local,dest=/tmp/.buildx-cache-new
|
|
|
-
|
|
|
- - name: Move cache
|
|
|
- run: |
|
|
|
- rm -rf /tmp/.buildx-cache
|
|
|
- mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
|
|
-
|
|
|
- - name: Image digest
|
|
|
- run: |
|
|
|
- echo ${{ steps.docker_build_adguardhome.outputs.digest }}
|
|
|
+ cache-from: type=gha
|
|
|
+ cache-to: type=gha,mode=max
|