Skip to content

Use env.

Use env. #5

Workflow file for this run

name: Build and Push Alpine Image
on:
push:
branches:
- main
paths:
- Dockerfile.alpine
- .github/workflows/alpine-push.yml
workflow_dispatch:
env:
DISTRO: alpine
IMAGENAME: openssh-client
SHORTDESCRIPTION: Base images from different distros with an OpenSSH __CLIENT__ added.
PLATFORMS: linux/amd64,linux/arm64
USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
IMAGE: ${{ env.USERNAME }}/${{ env.IMAGENAME }}

Check failure on line 19 in .github/workflows/alpine-push.yml

View workflow run for this annotation

GitHub Actions / Build and Push Alpine Image

Invalid workflow file

The workflow is not valid. .github/workflows/alpine-push.yml (Line: 19, Col: 10): Unrecognized named-value: 'env'. Located at position 1 within expression: env.USERNAME .github/workflows/alpine-push.yml (Line: 21, Col: 14): Unrecognized named-value: 'env'. Located at position 1 within expression: env.IMAGE
EXTRATAGS: ",${{ env.IMAGE }}:latest"
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ env.USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v6
with:
file: Dockerfile.${{ env.DISTRO }}
context: .
platforms: ${{ env.PLATFORMS }}
push: true
tags: ${{ env.IMAGE }}:${{ env.DISTRO }}${{ env.EXTRATAGS }}
-
name: Update repo description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ env.USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: ${{ env.IMAGE }}
short-description: ${{ env.$SHORTDESCRIPTION }}