File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9999 platforms : linux/amd64
100100 cache-from : type=gha
101101 cache-to : type=gha,mode=max
102+
103+ payment-service-build-and-push :
104+ # needs: build
105+ runs-on : ubuntu-latest
106+ if : github.ref == 'refs/heads/main' || github.ref == 'refs/heads/ci' || startsWith(github.ref, 'refs/tags/')
107+ defaults :
108+ run :
109+ working-directory : 3-payment-service
110+
111+ steps :
112+ - uses : actions/checkout@v4
113+
114+ - name : Set up Docker Buildx
115+ uses : docker/setup-buildx-action@v3
116+
117+ - name : Login to Docker Hub
118+ uses : docker/login-action@v3
119+ with :
120+ username : ${{ secrets.DOCKER_USERNAME }}
121+ password : ${{ secrets.DOCKER_PASSWORD }}
122+
123+ - name : Set environment variables
124+ run : |
125+ echo "IMAGE_NAME=${{ secrets.DOCKER_USERNAME }}/${{ vars.IMAGE_NAME_2 }}" >> $GITHUB_ENV
126+ echo "IMAGE_TAG=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV
127+ if [[ $GITHUB_REF == refs/tags/* ]]; then
128+ echo "IMAGE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
129+ fi
130+
131+ - name : Build and Push Docker Image
132+ uses : docker/build-push-action@v5
133+ with :
134+ context : ./3-payment-service
135+ push : ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/ci' || startsWith(github.ref, 'refs/tags/') }}
136+ tags : |
137+ ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
138+ platforms : linux/amd64
139+ cache-from : type=gha
140+ cache-to : type=gha,mode=max
You can’t perform that action at this time.
0 commit comments