Fixed 'deprecated' warnings in gh-workflows (#5720)

This commit is contained in:
Simon Schön 2024-01-21 21:49:31 +01:00 committed by GitHub
parent a2aed9e772
commit 327f29159e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 23 additions and 15 deletions

View File

@ -13,7 +13,7 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v4
with: with:
# We must fetch at least the immediate parents so that if this is # We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head. # a pull request then we can checkout the head.

View File

@ -14,8 +14,8 @@ jobs:
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
- uses: actions/setup-python@v2 - uses: actions/setup-python@v5
with: with:
python-version: 3.x python-version: 3.x
- run: pip install --upgrade pip - run: pip install --upgrade pip

View File

@ -5,48 +5,56 @@ on:
- master - master
release: release:
types: [published] types: [published]
env: env:
REGISTRY: ghcr.io REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }} IMAGE_NAME: ${{ github.repository }}
jobs: jobs:
check-token: check-token:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
token: ${{ steps.token.outputs.defined }} token_defined: ${{ steps.token_check.outputs.token_defined }}
steps: steps:
- id: token - name: Check token
id: token_check
env: env:
MY_TOKEN: ${{ secrets.MY_TOKEN }} MY_TOKEN: ${{ secrets.MY_TOKEN }}
if: "${{ env.MY_TOKEN != '' }}" if: "${{ env.MY_TOKEN != '' }}"
run: echo "::set-output name=defined::true" run: echo "token_defined=true" >> "$GITHUB_OUTPUT"
build: build:
name: Release name: Release
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [check-token] needs: [check-token]
if: needs.check-token.outputs.token == 'true' if: needs.check-token.outputs.token_defined == 'true'
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v2 uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry - name: Log in to the Container registry
uses: docker/login-action@v2 uses: docker/login-action@v3
with: with:
registry: ${{ env.REGISTRY }} registry: ${{ env.REGISTRY }}
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.MY_TOKEN }} password: ${{ secrets.MY_TOKEN }}
- name: Extract metadata (tags, labels) for Docker - name: Extract metadata (tags, labels) for Docker
id: meta id: meta
uses: docker/metadata-action@v4 uses: docker/metadata-action@v5
with: with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image - name: Build and push Docker image
uses: docker/build-push-action@v3 uses: docker/build-push-action@v5
with: with:
context: . context: .
file: docker/Dockerfile file: docker/Dockerfile

View File

@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Release - name: Release