Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace set-output with env variable and remove single quotes on labels #1022

Merged
merged 1 commit into from
Nov 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions .github/workflows/container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d')"
- name: Set image version
run: echo IMAGE_VERSION=$(date +'%Y%m%d') >> $GITHUB_ENV

- name: Normalise image name
run: |
echo IMAGE_NAME=$(echo '${{ github.repository_owner }}/${{ inputs.image_name }}' | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
run: echo IMAGE_NAME=$(echo '${{ github.repository_owner }}/${{ inputs.image_name }}' | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV

- name: Login to GHCR
uses: docker/login-action@v2
Expand All @@ -58,11 +56,11 @@ jobs:
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.date.outputs.date }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_VERSION }}
labels: |
org.opencontainers.image.licenses='Apache-2.0'
org.opencontainers.image.revision='${{ github.sha }}'
org.opencontainers.image.source='${{ github.server_url }}/${{ github.repository }}'
org.opencontainers.image.title='${{ inputs.image_name }}'
org.opencontainers.image.vendor='Google LLC'
org.opencontainers.image.version='${{ steps.date.outputs.date }}'
org.opencontainers.image.licenses=Apache-2.0
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
org.opencontainers.image.title=${{ inputs.image_name }}
org.opencontainers.image.vendor=Google LLC
org.opencontainers.image.version=${{ env.IMAGE_VERSION }}