github: run actions only on certain paths #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker | |
on: | |
schedule: | |
- cron: '24 1 * * 1' | |
push: | |
branches: [ "main" ] | |
paths: | |
- 'scripts/**' | |
- 'Dockerfile' | |
- 'entrypoint.sh' | |
- '.github/workflows/**' | |
env: | |
# Use docker.io for Docker Hub if empty | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Log in to Docker | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
#username: ${{ github.actor }} | |
username: voxelbonecloud | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Build and push | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: ghcr.io/${{ env.IMAGE_NAME }}:${{ github.ref_name }} |