File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 11
11
build :
12
12
runs-on : ubuntu-latest
13
13
steps :
14
- - uses : actions/checkout@v4
15
- - name : Build the Docker image
16
- run : docker build . --file Dockerfile --tag ib-systems/openstack-peepo-exporter:$(date +%s)
14
+ - name : Checkout code
15
+ uses : actions/checkout@v4
16
+
17
+ - name : Log in to ghcr.io
18
+ run : echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
19
+
20
+ - name : Build and tag image
21
+ run : |
22
+ COMMIT_SHA=$(echo $GITHUB_SHA | cut -c1-7)
23
+ docker build -t ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:$COMMIT_SHA .
24
+ - name : Push image to GHCR
25
+ run : docker push ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:$COMMIT_SHA
You can’t perform that action at this time.
0 commit comments