safer login
This commit is contained in:
parent
2781566cb3
commit
3c3f9140f7
1 changed files with 6 additions and 7 deletions
13
.github/workflows/package.yaml
vendored
13
.github/workflows/package.yaml
vendored
|
|
@ -46,13 +46,12 @@ jobs:
|
|||
- name: Build Docker Image
|
||||
run: docker build --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" docker/
|
||||
|
||||
- name: Log in to registry
|
||||
run: |
|
||||
if [[ ${{ github.ref }} == 'refs/head/master' ]]; then
|
||||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
|
||||
else
|
||||
echo "Skipped on PRs"
|
||||
fi
|
||||
- name: login to GitHub Container Registry
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Push image
|
||||
run: |
|
||||
|
|
|
|||
Loading…
Reference in a new issue