File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build and publish Docker image
2+
3+ # On every pull request, but only on push to main
4+ on :
5+ push :
6+ branches :
7+ - feature/container-build-n-push
8+ tags :
9+ - ' *'
10+ pull_request :
11+ workflow_dispatch :
12+
13+ env :
14+ LATEST_PY_VERSION : ' 3.11'
15+
16+ jobs :
17+ build :
18+ runs-on : ubuntu-latest
19+
20+ steps :
21+ - name : Checkout code
22+ uses : actions/checkout@v3
23+
24+ - name : Set up Docker Buildx
25+ uses : docker/setup-buildx-action@v2
26+
27+ - name : Log in to GitHub Container Registry
28+ uses : docker/login-action@v2
29+ with :
30+ registry : ghcr.io
31+ username : ${{ github.actor }}
32+ password : ${{ secrets.GITHUB_TOKEN }}
33+
34+ - name : Build Docker image
35+ run : |
36+ docker build -t ghcr.io/${{ github.repository }}:${{ github.sha }} .
37+
38+ - name : Push Docker image
39+ run : |
40+ docker push ghcr.io/${{ github.repository }}:${{ github.sha }}
You can’t perform that action at this time.
0 commit comments