name: Docker on: schedule: - cron: '0 6 * * 0' push: branches: [ "main" ] tags: [ 'v*.*.*' ] pull_request: branches: [ "main" ] env: # Use docker.io or ghcr.io REGISTRY: docker.io IMAGE_NAME: ${{ github.repository.split('/')[1] }} RELEASE: latest jobs: build: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Log into registry ${{ env.REGISTRY }} uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ secrets.DOCKER_USER }} password: ${{ secrets.DOCKER_PASS }} - name: Build and push Docker image run: docker build -t ${{ env.IMAGE_NAME }} .