diff --git a/.github/workflows/arm-docker-publish.yml b/.github/workflows/arm-docker-publish.yml index 5eb3b93..11905b3 100644 --- a/.github/workflows/arm-docker-publish.yml +++ b/.github/workflows/arm-docker-publish.yml @@ -1,16 +1,16 @@ -name: Build ARM image +name: Docker on: push: branches: [ "main" ] - # paths: - # - 'Dockerfile' - # - 'src/**' + paths: + - 'Dockerfile' + - 'src/**' pull_request: branches: [ "main" ] - # paths: - # - 'Dockerfile' - # - 'src/**' + paths: + - 'Dockerfile' + - 'src/**' env: IMAGE_NAME: watchyourlan @@ -32,13 +32,13 @@ jobs: id: buildx uses: docker/setup-buildx-action@v2 - - name: Login to GHCR - # if: github.event_name != 'pull_request' - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + # - name: Login to GHCR + # # if: github.event_name != 'pull_request' + # uses: docker/login-action@v2 + # with: + # registry: ghcr.io + # username: ${{ github.actor }} + # password: ${{ secrets.GITHUB_TOKEN }} - name: Login to Docker Hub # if: github.event_name != 'pull_request' diff --git a/.github/workflows/ghcr-publish.yml b/.github/workflows/ghcr-publish.yml new file mode 100644 index 0000000..296ce7b --- /dev/null +++ b/.github/workflows/ghcr-publish.yml @@ -0,0 +1,44 @@ +name: Publish to ghcr.io + +on: + push: + branches: [ "main" ] + paths: + - 'Dockerfile' + - 'src/**' + pull_request: + branches: [ "main" ] + paths: + - 'Dockerfile' + - 'src/**' + +env: + IMAGE_NAME: watchyourlan + TAGS: latest, v0.7.3 + + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Build and Push Docker Image to ghcr.io + uses: mr-smithers-excellent/docker-build-push@v5 + with: + image: ${{ env.IMAGE_NAME }} + tags: ${{ env.TAGS }} + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # - name: Build and Push Docker Image to docker.io + # uses: mr-smithers-excellent/docker-build-push@v5 + # with: + # image: ${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }} + # tags: ${{ env.TAGS }} + # registry: docker.io + # username: ${{ secrets.DOCKER_USERNAME }} + # password: ${{ secrets.DOCKER_PASSWORD }} \ No newline at end of file