File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Build and Push Docker Image
2+
3+ on :
4+ push :
5+ branches : [main]
6+ tags : ["v*"]
7+ pull_request :
8+ branches : [main]
9+ workflow_dispatch :
10+
11+ concurrency :
12+ group : ${{ github.workflow }}-${{ github.ref }}
13+ cancel-in-progress : true
14+
15+ env :
16+ IMAGE_NAME : bysages/lens
17+
18+ jobs :
19+ build :
20+ runs-on : ubuntu-latest
21+
22+ permissions :
23+ contents : read
24+ packages : write
25+
26+ steps :
27+ - uses : actions/checkout@v4
28+
29+ - name : Log in to Docker Hub
30+ if : github.event_name != 'pull_request'
31+ uses : docker/login-action@v3
32+ with :
33+ username : ${{ secrets.DOCKER_USERNAME }}
34+ password : ${{ secrets.DOCKER_PASSWORD }}
35+
36+ # create a unique tag for each build for debugging
37+ - name : Set Docker tag
38+ id : date
39+ run : echo "date_stamp=$(date +%s)" >> "$GITHUB_OUTPUT"
40+
41+ - name : Build and push Docker images
42+ uses : iloveitaly/github-action-nixpacks@main
43+ with :
44+ push : ${{ github.event_name != 'pull_request' }}
45+ tags : |
46+ ${{ env.IMAGE_NAME }}:latest
47+ ${{ env.IMAGE_NAME }}:${{ steps.date.outputs.date_stamp }}
48+ ${{ env.IMAGE_NAME }}:${{ github.sha }}
You can’t perform that action at this time.
0 commit comments