Open iamalexmang opened 3 years ago
Hi @iamalexmang, You can fix it by setting the branch and passing it with the build-args. Please see code below.
steps:
- uses: actions/checkout@v2
- name: Set BRANCH
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Set up Buildx
uses: docker/setup-buildx-action@v1
<skipped>
- name: Build and push production image
uses: docker/build-push-action@v2.6.1
with:
context: .
tags: ${{secrets.ACR_NAME}}/contoso-website:latest,${{secrets.ACR_NAME}}/contoso-website:${{ env.BRANCH }}
push: true
build-args: |
BRANCH=${{ env.BRANCH }}
I'm getting
buildx failed with: error: invalid tag "***/contoso-website:${GITHUB_REF#refs/tags}": invalid reference format
for the production builds.