emem
10/13/2022, 5:00 PMjobs:
staging_environment:
runs-on: ubuntu:latest
- name: BuildandPush
id: build-and-push
uses: docker/build-push-action@v2
env:
REPOSITORY_URI: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ github.head_ref || github.ref_name }}-${{ github.sha }}
- name: update image
run: |
echo $IMAGE_TAG
I will like to be able to reuse the value of from IMAGE_TAG from previous stepsmanagedkaos
10/13/2022, 5:45 PMmanagedkaos
10/13/2022, 5:45 PMecho "{environment_variable_name}={value}" >> $GITHUB_ENVmanagedkaos
10/13/2022, 5:49 PMdocker/build-push-action env section
3. Use the same IMAGE_TAG env var later on in the workflow