Browse Source

Add push action for test image.

scossu 1 year ago
parent
commit
50d45132e0
1 changed files with 31 additions and 0 deletions
  1. 31 0
      .github/workflows/push-test-image.yml

+ 31 - 0
.github/workflows/push-test-image.yml

@@ -0,0 +1,31 @@
+name: Push test image to Docker Hub.
+on:
+  push:
+    branch:
+      - "main"
+
+env:
+  DOCKER_USER: lcnetdev
+  DOCKER_PASSWORD: ${{secrets.DOCKER_HUB}}
+  REPO_NAME: scriptshifter
+
+jobs:
+  push-image-to-docker-hub:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v3
+        with:
+          submodules: recursive
+
+      - name: Build the Docker image
+        run: docker build . --tag $DOCKER_USER/$REPO_NAME:test
+
+      - name: Login to Docker Hub
+        uses: docker/login-action@v3
+        with:
+          username: lcnetdev
+          password: ${{ secrets.DOCKER_HUB }}
+
+      - name: Push to Docker Hub
+        run: docker push $DOCKER_USER/$REPO_NAME:test
+