Skip to content

Bump actions/download-artifact from 2.0.10 to 4.1.7 in /.github/workflows #86

Bump actions/download-artifact from 2.0.10 to 4.1.7 in /.github/workflows

Bump actions/download-artifact from 2.0.10 to 4.1.7 in /.github/workflows #86

Workflow file for this run

# Builds and Pushes Docker image for PRs with label `pr-docker-build` to GHCR only.
name: Docker Build and Push - PRs
on:
pull_request:
types: [ opened, reopened, synchronize, labeled ]
jobs:
push:
name: Build and Push Docker Image
if: ${{ contains(github.event.pull_request.labels.*.name, 'pr-docker-build') }}
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v3
- name: Build Docker Image
run: docker build . --file Dockerfile --tag $(echo "${{ github.repository }}" | sed -e 's,.*/\(.*\),\1,') --label "runnumber=${GITHUB_RUN_ID}" --label "gitsha=${{ github.sha }}"
- name: GitHub Container Registry Login
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Push Docker Image to GHCR
run: |
IMAGE_NAME=$(echo "${{ github.repository }}" | sed -e 's,.*/\(.*\),\1,')
IMAGE_ID=ghcr.io/${{ github.repository }}
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Lowercase branch name
VERSION=$(echo "${{ github.head_ref }}" | tr '[A-Z]' '[a-z]' | sed -e 's,.*/\(.*\),\1,')
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION