Skip to content

Commit f0e7ad0

Browse files
committed
ci 🦊: Payment Service
1 parent 67bdcae commit f0e7ad0

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/node.js.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,42 @@ jobs:
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

0 commit comments

Comments
 (0)