Skip to content

Commit d77e2ee

Browse files
committed
Change to github registry
1 parent f86dcdc commit d77e2ee

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

.github/workflows/main.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,27 +96,28 @@ jobs:
9696
artifact-name: sbom.spdx.json # queda como artefacto del job
9797

9898
publish:
99-
name: Publish to Docker Hub
99+
name: Publish to GitHub Container Registry
100100
runs-on: ubuntu-latest
101101
needs: [sast]
102102
steps:
103103
- name: Checkout
104104
uses: actions/checkout@v4
105105

106-
- name: Log in to Docker Hub
107-
uses: docker/login-action@v3
106+
- name: Log in to GitHub Container Registry
107+
uses: docker/login-action@v2
108108
with:
109-
username: ${{ vars.DOCKERHUB_USERNAME }}
110-
password: ${{ secrets.DOCKERHUB_TOKEN }}
109+
registry: ghcr.io
110+
username: ${{ github.actor }}
111+
password: ${{ secrets.GITHUB_TOKEN }}
111112

112113
- name: Build and push image
113114
uses: docker/build-push-action@v4
114115
with:
115116
context: ${{ env.APP_DIR }}
116117
push: true
117118
tags: |
118-
${{ vars.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
119-
${{ vars.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest
119+
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
120+
ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest
120121
121122
122123
# ─────────────────────────────────────────────────────────────────────────────

0 commit comments

Comments
 (0)