Merge pull request #452 from miaowware/set-output

.github/workflows/docker.yml: remove deprecated set-output
This commit is contained in:
0x5c 2022-10-11 18:14:12 -04:00 committed by GitHub
commit c3fbd3e719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

View File

@ -29,8 +29,8 @@ jobs:
run: | run: |
IMAGE_ID=${GITHUB_REPOSITORY,,} IMAGE_ID=${GITHUB_REPOSITORY,,}
IMAGE_NAME=${IMAGE_ID#*/} IMAGE_NAME=${IMAGE_ID#*/}
echo ::set-output name=image_id::$IMAGE_ID echo "image_id=$IMAGE_ID" >> $GITHUB_ENV
echo ::set-output name=image_name::$IMAGE_NAME echo "image_name=$IMAGE_NAME" >> $GITHUB_ENV
docker build . --file Dockerfile -t $IMAGE_NAME docker build . --file Dockerfile -t $IMAGE_NAME
- name: Login to Github Container Registry - name: Login to Github Container Registry
@ -43,10 +43,10 @@ jobs:
- name: Tag image - name: Tag image
id: tag_image id: tag_image
run: | run: |
IMAGE_NAME=${{ steps.build_image.outputs.image_name }} IMAGE_NAME=${{ env.image_name }}
IMAGE_ID=ghcr.io/${{ steps.build_image.outputs.image_id }} IMAGE_ID=ghcr.io/${{ env.image_id }}
echo IMAGE_ID=$IMAGE_ID echo IMAGE_ID=$IMAGE_ID
echo ::set-output name=image_id::$IMAGE_ID echo "image_id=$IMAGE_ID" >> $GITHUB_ENV
# Strip git ref prefix from version # Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
@ -55,7 +55,7 @@ jobs:
# if version is master, set version to dev # if version is master, set version to dev
[[ "$VERSION" == "master" ]] && VERSION=dev [[ "$VERSION" == "master" ]] && VERSION=dev
echo VERSION=$VERSION echo VERSION=$VERSION
echo ::set-output name=version::$VERSION echo "version=$VERSION" >> $GITHUB_ENV
# tag dev or x.x.x # tag dev or x.x.x
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
@ -64,8 +64,8 @@ jobs:
- name: Push images to registry - name: Push images to registry
run: | run: |
VERSION=${{ steps.tag_image.outputs.version }} VERSION=${{ env.version }}
IMAGE_ID=${{ steps.tag_image.outputs.image_id }} IMAGE_ID=${{ env.image_id }}
[[ "$VERSION" != "dev" ]] && docker push $IMAGE_ID:latest || true [[ "$VERSION" != "dev" ]] && docker push $IMAGE_ID:latest || true
docker push $IMAGE_ID:$VERSION docker push $IMAGE_ID:$VERSION
@ -77,4 +77,4 @@ jobs:
url: ${{ secrets.DEPLOY_URL }} url: ${{ secrets.DEPLOY_URL }}
method: POST method: POST
headers: '{"Authentication": "Token ${{ secrets.DEPLOY_TOKEN }}"}' headers: '{"Authentication": "Token ${{ secrets.DEPLOY_TOKEN }}"}'
payload: '{"version": "${{ steps.tag_image.outputs.version }}"}' payload: '{"version": "${{ env.version }}"}'

View File

@ -187,7 +187,7 @@ def _calc_volt(db: float, ref: float):
# testing code # testing code
if __name__ == "__main__": if __name__ == "__main__":
while(True): while True:
try: try:
ip = input("> ").split() ip = input("> ").split()
initial = float(ip[0]) initial = float(ip[0])