Skip to content

Commit b4a534f

Browse files
committed
Upload Docker image to ghcr.io instead of Docker Hub
1 parent 0af48f3 commit b4a534f

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

‎.github/workflows/docker-image.yml‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@ on:
99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
packages: write
1215
steps:
13-
- uses: actions/checkout@v1
16+
- uses: actions/checkout@v4
1417

15-
- name: Login to Docker Hub
18+
- name: Login to GitHub Container Registry
1619
if: github.event_name != 'push'
17-
uses: docker/login-action@v2
20+
uses: docker/login-action@v3
1821
with:
19-
username: ${{ secrets.DOCKER_LOGIN }}
20-
password: ${{ secrets.DOCKER_API_TOKEN }}
22+
registry: ghcr.io
23+
username: ${{ github.actor }}
24+
password: ${{ secrets.GITHUB_TOKEN }}
2125

2226
- name: Construct image tag
2327
id: tags
@@ -26,9 +30,9 @@ jobs:
2630
- name: Build and push Docker image
2731
if: github.event_name != 'push'
2832
run: |
29-
docker build . --file Dockerfile --tag snmetamorph/xashds-hldm:${{ steps.tags.outputs.date_tag }} --tag snmetamorph/xashds-hldm:latest
30-
docker push snmetamorph/xashds-hldm:${{ steps.tags.outputs.date_tag }}
31-
docker push snmetamorph/xashds-hldm:latest
33+
docker build . --file Dockerfile --tag ghcr.io/${{ github.repository_owner }}/xashds-hldm:${{ steps.tags.outputs.date_tag }} --tag ghcr.io/${{ github.repository_owner }}/xashds-hldm:latest
34+
docker push ghcr.io/${{ github.repository_owner }}/xashds-hldm:${{ steps.tags.outputs.date_tag }}
35+
docker push ghcr.io/${{ github.repository_owner }}/xashds-hldm:latest
3236
3337
- name: Build Docker image
3438
if: github.event_name == 'push'

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ You can use this Docker Compose file below as a base for your custom configurati
1313
```yaml
1414
services:
1515
xashds:
16-
image: snmetamorph/xashds-hldm:latest
16+
image: ghcr.io/FWGS/xashds-hldm:latest
1717
build: .
1818
container_name: xashds-hldm
1919
restart: always

0 commit comments

Comments
 (0)