We can use wildcard patterns to specify paths to upload in a workflow. We can also exclude some files/folders. Picture the following folder structure for a simple Django web app. You do not need to be a Django developer to understand the logic:
.github
├── workflows
└── using_wildcards.yml
myapp
├── __init__.py
└── models.py
├──...
myproj
├── __init__.py
└── settings.py
└── log.log
├──...
env
├── Include
└── django
└── contrib
├──...
├──...
The uploaded artifacts will be deployed to the cloud, but not everyone is invited to the party:
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build
path: |
./*
./myapp/*
!./env/*
./myproj/**
!./myproj/**/*.log
!./.github/**
Tick appropriately to indicate whether files/folders would be included or excluded.