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
|
- name: Build Docker Image
|
||||||
run: docker build --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" docker/
|
run: docker build --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" docker/
|
||||||
|
|
||||||
- name: Log in to registry
|
- name: login to GitHub Container Registry
|
||||||
run: |
|
uses: docker/login-action@v1
|
||||||
if [[ ${{ github.ref }} == 'refs/head/master' ]]; then
|
with:
|
||||||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
|
registry: ghcr.io
|
||||||
else
|
username: ${{ github.actor }}
|
||||||
echo "Skipped on PRs"
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Push image
|
- name: Push image
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue