Skip to content

Commit ec2be8d

Browse files
authored
fix(ci): build and publish docker images for pull requests (#1)
1 parent 5c93028 commit ec2be8d

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,22 @@ jobs:
2828
password: ${{ secrets.DOCKERHUB_TOKEN }}
2929

3030
- name: Get current date
31+
if: github.ref == 'refs/heads/main'
3132
id: date
3233
run: echo "DATE=$(date +'%d-%m-%y')" >> $GITHUB_ENV
3334

35+
- name: Get Pull Request ID
36+
if: github.event_name == 'pull_request'
37+
id: pr
38+
run: echo "PR_ID=${{ github.event.pull_request.number }}" >> $GITHUB_ENV
39+
3440
- name: Build and Push Docker Image
3541
uses: docker/build-push-action@v4
3642
with:
3743
context: .
3844
push: true
3945
tags: |
40-
shmayro/dockerify-android:latest
41-
shmayro/dockerify-android:${{ env.DATE }}
46+
${{ github.ref == 'refs/heads/main' && 'shmayro/dockerify-android:latest' || '' }}
47+
${{ github.ref == 'refs/heads/main' && format('shmayro/dockerify-android:{0}', env.DATE) || '' }}
48+
${{ github.event_name == 'pull_request' && format('shmayro/dockerify-android:pr-{0}', env.PR_ID) || '' }}
4249
platforms: linux/amd64

first-boot.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ apply_settings() {
1616
adb shell settings put system screen_off_timeout 15000
1717
adb shell settings put global private_dns_mode hostname
1818
adb shell settings put global private_dns_specifier dns2024.haroun.dev
19-
adb shell svc wifi disable
19+
# adb shell svc wifi disable
2020
}
2121

2222
# Detect ip and forward ADB ports from the container's network

0 commit comments

Comments
 (0)