Skip to content

Commit 7455718

Browse files
authored
Update docker-image.yml
1 parent ff5aa72 commit 7455718

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

.github/workflows/docker-image.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,25 @@ on:
77
branches: [ "main" ]
88

99
jobs:
10-
1110
build:
12-
1311
runs-on: ubuntu-latest
1412

1513
steps:
1614
- uses: actions/checkout@v4
17-
- name: Build the Docker image
18-
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
15+
16+
- name: Log in to GitHub Container Registry
17+
uses: docker/login-action@v3
18+
with:
19+
registry: ghcr.io
20+
username: ${{ github.actor }}
21+
password: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- name: Build Docker image with tags
24+
run: |
25+
IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/Microsoft-Rewards-Script
26+
docker build . --file Dockerfile --tag $IMAGE_NAME:latest --tag $IMAGE_NAME:$(date +%s)
27+
28+
- name: Push Docker image
29+
run: |
30+
IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/Microsoft-Rewards-Script
31+
docker push $IMAGE_NAME:latest

0 commit comments

Comments
 (0)