File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ name : build
2+
3+
4+ on :
5+ push :
6+ branches : [ master ]
7+ pull_request :
8+ branches : [ master ]
9+
10+
11+ env :
12+ ACCOUNT : ${{ github.repository_owner }}
13+ REPOSITORY : ${{ github.event.repository.name }}
14+
15+
16+ jobs :
17+
18+ build :
19+ runs-on : ubuntu-latest
20+ container : docker:git
21+ permissions :
22+ contents : read
23+ packages : write
24+ steps :
25+ - uses : actions/checkout@v3
26+ - name : resolve paths-filter error
27+ run : git config --global --add safe.directory /__w/${REPOSITORY}/${REPOSITORY}
28+ - name : detect build file changes
29+ uses : dorny/paths-filter@v2
30+ id : filter
31+ with :
32+ filters : |
33+ buildfiles:
34+ - Dockerfile
35+ - requirements.txt
36+ - tests/requirements-test.txt
37+ - name : build & push image to registry
38+ if : steps.filter.outputs.buildfiles == 'true'
39+ run : |
40+ echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $ACCOUNT --password-stdin
41+ docker build -t ghcr.io/${ACCOUNT}/${REPOSITORY} .
42+ docker push ghcr.io/${ACCOUNT}/${REPOSITORY}
You can’t perform that action at this time.
0 commit comments