Skip to content

Commit f60a248

Browse files
authored
Update main.yml
1 parent a86f51d commit f60a248

1 file changed

Lines changed: 26 additions & 3 deletions

File tree

.github/workflows/main.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ on:
55
pull_request:
66
workflow_dispatch:
77

8+
permissions:
9+
contents: read
10+
packages: write
11+
12+
env:
13+
REGISTRY: ghcr.io
14+
IMAGE_NAME: $${{ github.repository }}
15+
816
jobs:
917
build-container:
1018
runs-on: ubuntu-latest
@@ -19,9 +27,24 @@ jobs:
1927
- name: Set up Docker Buildx
2028
uses: docker/setup-buildx-action@v3
2129

22-
- name: docker login
30+
# - name: docker login
31+
# uses: docker/login-action@v3.6.0
32+
# with:
33+
# username: ${{ secrets.DOCKERHUB_USER }}
34+
# password: ${{ secrets.DOCKERHUB_PASSWORD }}
35+
36+
- name: docker login to GHCR
2337
uses: docker/login-action@v3.6.0
2438
with:
25-
username: ${{ secrets.DOCKERHUB_USER }}
26-
password: ${{ secrets.DOCKERHUB_PASSWORD }}
39+
registry: ${{ env.REGISTRY }}
40+
username: ${{ github.actor }}
41+
password: ${{ secrets.GITHUB_TOKEN }}
42+
43+
- name: Build & Push Image
44+
uses: docker/build-push-action@v6.18.0
45+
with:
46+
context: .
47+
file: ./Dockerfile
48+
push: true
49+
tags: latest
2750

0 commit comments

Comments
 (0)