File tree 1 file changed +47
-0
lines changed
1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : build
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+
8
+ workflow_dispatch :
9
+
10
+ jobs :
11
+ build :
12
+ runs-on : ubuntu-latest
13
+ permissions :
14
+ contents : read
15
+ packages : write
16
+
17
+ steps :
18
+ - name : Checkout
19
+ uses : actions/checkout@v4
20
+
21
+ - name : Login to GitHub Container Registry
22
+ uses : docker/login-action@v3
23
+ with :
24
+ registry : ghcr.io
25
+ username : ${{ github.actor }}
26
+ password : ${{ secrets.GITHUB_TOKEN }}
27
+
28
+ - name : Set some env vars for the build
29
+ run : |
30
+ TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)
31
+ echo "COMMIT=${GITHUB_SHA:0:7}" >> $GITHUB_ENV
32
+ echo "LASTMOD=${TIMESTAMP}" >> $GITHUB_ENV
33
+ echo "IMAGE_NAME=redirect2me/siterank" >> $GITHUB_ENV
34
+
35
+ - name : Build and push
36
+ uses : docker/build-push-action@v5
37
+ with :
38
+ context : .
39
+ file : ./Dockerfile
40
+ push : true
41
+ tags : |
42
+ ghcr.io/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
43
+ ghcr.io/${{ env.IMAGE_NAME }}:latest
44
+ build-args : |
45
+ COMMIT=${{ env.COMMIT }}
46
+ LASTMOD=${{ env.LASTMOD }}
47
+
You can’t perform that action at this time.
0 commit comments