try different env use

This commit is contained in:
Oliver Gorwits
2021-08-21 11:30:24 +01:00
parent 26547aa05b
commit 0dc9428f1d

View File

@@ -136,8 +136,8 @@ jobs:
- name: Get the Tag - name: Get the Tag
run: | run: |
echo "TAG=${GITHUB_REF#refs/(heads/tags)/}" >> $GITHUB_ENV echo "TAG=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV
echo "IMAGE_ROOT=netdisco:${GITHUB_REF#refs/(heads|tags)/}" >> $GITHUB_ENV echo "IMAGE_ROOT=netdisco:$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV
- name: Build netdisco-postgresql - name: Build netdisco-postgresql
run: | run: |
@@ -190,33 +190,43 @@ jobs:
docker tag ${IMAGE_ROOT}-$image netdisco/netdisco:latest-$image docker tag ${IMAGE_ROOT}-$image netdisco/netdisco:latest-$image
done done
- name: Upload to Docker Hub - name: Login to DH
id: upload_docker_hub
if: startsWith(github.ref, 'refs/tags/')
env: env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: | run: |
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD echo "${{ env.DOCKER_PASSWORD }}" | docker login -u "${{ env.DOCKER_USERNAME }}" --password-stdin
- name: Upload to Docker Hub
id: upload_docker_hub
if: startsWith(github.ref, 'refs/tags/')
run: |
for image in postgresql backend web do; do for image in postgresql backend web do; do
docker push netdisco/${IMAGE_ROOT}-$image docker push netdisco/${IMAGE_ROOT}-$image
docker push netdisco/netdisco:latest-$image docker push netdisco/netdisco:latest-$image
done done
docker logout
continue-on-error: true continue-on-error: true
- name: Logout from DH
run: docker logout
- name: Login to GHP
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
- name: Upload to GitHub Packages - name: Upload to GitHub Packages
id: upload_github_packages id: upload_github_packages
if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')
run: | run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
for image in postgresql backend web do; do for image in postgresql backend web do; do
docker push netdisco/${IMAGE_ROOT}-$image docker push netdisco/${IMAGE_ROOT}-$image
docker push netdisco/netdisco:latest-$image docker push netdisco/netdisco:latest-$image
done done
docker logout
continue-on-error: true continue-on-error: true
- name: Logout from GHP
run: docker logout
- name: IRC DH upload failure notification - name: IRC DH upload failure notification
uses: Gottox/irc-message-action@v2 uses: Gottox/irc-message-action@v2
if: steps.upload_docker_hub.outcome == 'failure' if: steps.upload_docker_hub.outcome == 'failure'