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 : API - Production Build
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ paths :
8+ - ' tree-disk-api/**'
9+ workflow_dispatch :
10+
11+ env :
12+ GITHUB_REGISTRY : ghcr.io
13+ IMAGE_NAME : tuke307/tree-disk-api
14+
15+ jobs :
16+ build :
17+ runs-on : ubuntu-latest
18+ # permissions needed to push to ghcr.io
19+ permissions :
20+ contents : read
21+ packages : write
22+ steps :
23+ - uses : actions/checkout@v4
24+
25+ - name : Set up Docker Buildx
26+ uses : docker/setup-buildx-action@v3
27+
28+ - name : Login to ${{ env.GITHUB_REGISTRY }}
29+ uses : docker/login-action@v3
30+ with :
31+ registry : ${{ env.GITHUB_REGISTRY }}
32+ username : ${{ github.actor }}
33+ password : ${{ secrets.GITHUB_TOKEN }}
34+
35+ - name : Build and Push Image
36+ uses : docker/build-push-action@v6
37+ with :
38+ context : ./tree-disk-api
39+ file : ./tree-disk-api/Dockerfile
40+ platforms : linux/amd64
41+ push : true
42+ cache-from : type=gha,scope=${{ github.workflow }}
43+ cache-to : type=gha,mode=max,scope=${{ github.workflow }}
44+ tags : |
45+ ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:latest
46+ ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
Original file line number Diff line number Diff line change 1+ name : APP - Production Build
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ paths :
8+ - ' tree-disk-app/**'
9+ workflow_dispatch :
10+
11+ env :
12+ GITHUB_REGISTRY : ghcr.io
13+ IMAGE_NAME : tuke307/tree-disk-app
14+
15+ jobs :
16+ build :
17+ runs-on : ubuntu-latest
18+ # permissions needed to push to ghcr.io
19+ permissions :
20+ contents : read
21+ packages : write
22+ steps :
23+ - uses : actions/checkout@v4
24+
25+ - name : Set up Docker Buildx
26+ uses : docker/setup-buildx-action@v3
27+
28+ - name : Login to ${{ env.GITHUB_REGISTRY }}
29+ uses : docker/login-action@v3
30+ with :
31+ registry : ${{ env.GITHUB_REGISTRY }}
32+ username : ${{ github.actor }}
33+ password : ${{ secrets.GITHUB_TOKEN }}
34+
35+ - name : Build and Push Image
36+ uses : docker/build-push-action@v6
37+ with :
38+ context : ./tree-disk-app
39+ file : ./tree-disk-app/Dockerfile
40+ platforms : linux/amd64
41+ push : true
42+ cache-from : type=gha,scope=${{ github.workflow }}
43+ cache-to : type=gha,mode=max,scope=${{ github.workflow }}
44+ tags : |
45+ ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:latest
46+ ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
You can’t perform that action at this time.
0 commit comments