chore: update Docker workflow to use secrets
- Change hardcoded Docker Hub username to use secrets - Update workflow to securely reference DockerHub credentials This update enhances the security of the GitHub Actions workflow by using secrets instead of exposing sensitive information in the codebase. This ensures that the Docker Hub username is kept private and reduces the risk of accidental exposure.
This commit is contained in:
parent
54133b2f87
commit
ec2c92e6c9
6
.github/workflows/docker.yml
vendored
6
.github/workflows/docker.yml
vendored
@ -21,15 +21,15 @@ jobs:
|
||||
VERSION="v${GIT_VERSION}"
|
||||
echo "VERSION=${VERSION}" >> $GITHUB_ENV
|
||||
echo "GIT_VERSION=${GIT_VERSION}" >> $GITHUB_ENV
|
||||
echo "LATEST_TAG=${{ env.REGISTRY }}/${{ vars.DOCKERHUB_USER }}/${{ env.IMAGE_NAME }}:latest" >> $GITHUB_OUTPUT"
|
||||
echo "VERSION_TAG=${{ env.REGISTRY }}/${{ vars.DOCKERHUB_USER }}/${{ env.IMAGE_NAME }}:${VERSION}" >> $GITHUB_OUTPUT"
|
||||
echo "LATEST_TAG=${{ env.REGISTRY }}/${{ secrets.DOCKERHUB_USER }}/${{ env.IMAGE_NAME }}:latest" >> $GITHUB_OUTPUT"
|
||||
echo "VERSION_TAG=${{ env.REGISTRY }}/${{ secrets.DOCKERHUB_USER }}/${{ env.IMAGE_NAME }}:${VERSION}" >> $GITHUB_OUTPUT"
|
||||
-
|
||||
name: Login to ${{ env.REGISTRY }}
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ vars.DOCKERHUB_USER }}
|
||||
username: ${{ secrets.DOCKERHUB_USER }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Set up QEMU
|
||||
|
Loading…
Reference in New Issue
Block a user