Skip to content

ENV interpolation within actions #26590

Answered by Yanjingzhu
dudo asked this question in Actions
Discussion options

You must be logged in to vote

Please add repository input in your docker/build-push-action@v1 step, like:

jobs:
  docker:
    name: Build and push Docker Image
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2 # https://github.com/actions/checkout
      - name: Set ENV
        run: echo "::set-env name=INPUT_REPOSITORY::${GITHUB_REPOSITORY}/${GITHUB_REPOSITORY##*/}"
      - uses: docker/build-push-action@v1 # https://github.com/marketplace/actions/build-and-push-docker-images
        with:
          username: $GITHUB_ACTOR
          password: ${{ secrets.GITHUB_TOKEN }}
          registry: docker.pkg.github.com
          repository: ${{env.INPUT_REPOSITORY}}
          tags: latest

Based on my te…

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Product Feedback
3 participants