Skip to content

Commit e706480

Browse files
committed
fixes image push
1 parent f51378c commit e706480

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.github/workflows/docker-image.yml

+13-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ jobs:
3636
tags: ${{ env.TEST_IMAGE_TAG }}
3737
outputs: type=docker,dest=/tmp/${{ env.TEMP_IMAGE_NAME }}.tar
3838

39+
- name: Move cache
40+
run: |
41+
rm -rf /tmp/.buildx-cache
42+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
43+
3944
- name: Load built image
4045
run: docker load -i /tmp/${{ env.TEMP_IMAGE_NAME }}.tar
4146

@@ -47,14 +52,20 @@ jobs:
4752
- name: Run Tests
4853
run: docker compose run --rm -e RAILS_ENV=test web bin/rails spec
4954

50-
- name: Push Docker Image (if on main)
55+
- name: Login to DockerHub
56+
uses: docker/login-action@v3
57+
with:
58+
username: ${{ secrets.DOCKERHUB_USERNAME }}
59+
password: ${{ secrets.DOCKERHUB_TOKEN }}
60+
61+
- name: Push Docker Image (if main branch)
5162
if: github.ref == 'refs/heads/main'
5263
uses: docker/build-push-action@v5
5364
with:
5465
context: .
5566
push: true
5667
target: deployment
57-
tags: ${{ env.TEST_IMAGE_TAG }}
68+
tags: xavius/wave-connect:${{ github.sha }}, xavius/wave-connect:latest
5869
#repository: your-docker-hub-username/your-repository-name
5970

6071
deploy:

0 commit comments

Comments
 (0)