Browse Source

Adjust CI workflows.

scossu 1 year ago
parent
commit
b4eb47d2a9

+ 34 - 0
.github/workflows/push-app-image.yml

@@ -0,0 +1,34 @@
+name: Push image to Docker Hub.
+on:
+  push:
+    tags:
+      - "v*.*.*"
+
+env:
+  DOCKER_USER: lcnetdev
+  DOCKER_PASSWORD: ${{secrets.DOCKER_HUB}}
+  REPO_NAME: scriptshifter
+
+jobs:
+  push-image-to-docker-hub:
+    runs-on: ubuntu-latest
+    steps:
+      - name: checkout repo
+        uses: actions/checkout@v4
+        with:
+          submodules: recursive
+
+      - name: Build the Docker image
+        run: >
+          docker build -f Dockerfile .
+          --tag $DOCKER_USER/$REPO_NAME:${{ github.ref_name }}
+          --tag $DOCKER_USER/$REPO_NAME:latest
+
+      - 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 --all-tags

+ 5 - 4
.github/workflows/push-docker-image.yml → .github/workflows/push-base-image.yml

@@ -1,13 +1,13 @@
-name: Push image to Docker Hub.
+name: Push base image to Docker Hub. Only on minor/major version update.
 on:
   push:
     tags:
-      - "v*.*.*"
+      - "v*.*.0"
 
 env:
   DOCKER_USER: lcnetdev
   DOCKER_PASSWORD: ${{secrets.DOCKER_HUB}}
-  REPO_NAME: scriptshifter
+  REPO_NAME: scriptshifter-base
 
 jobs:
   push-image-to-docker-hub:
@@ -32,7 +32,8 @@ jobs:
 
       - name: Build the Docker image
         run: >
-          docker build . --tag $DOCKER_USER/$REPO_NAME:${{ github.ref_name }}
+          docker build -f scriptshifter_base.Dockerfile .
+          --tag $DOCKER_USER/$REPO_NAME:${{ github.ref_name }}
           --tag $DOCKER_USER/$REPO_NAME:latest
 
       - name: Login to Docker Hub

+ 4 - 13
.github/workflows/push-test-image.yml

@@ -18,20 +18,11 @@ jobs:
         with:
           submodules: recursive
 
-      - name: checkout yiddish submodules (1/2)
-        uses: actions/checkout@v4
-        with:
-          repository: ibleaman/loshn-koydesh-pronunciation
-          path: ext/yiddish/yiddish/submodules/loshn-koydesh-pronunciation
-
-      - name: checkout yiddish submodules (2/2)
-        uses: actions/checkout@v4
-        with:
-          repository: ibleaman/hasidify_lexicon
-          path: ext/yiddish/yiddish/submodules/hasidify_lexicon
-
       - name: Build the Docker image
-        run: docker build . --tag $DOCKER_USER/$REPO_NAME:test
+        run: >
+          docker build -f Dockerfile .
+          --tag $DOCKER_USER/$REPO_NAME:${{ github.ref_name }}
+          --tag $DOCKER_USER/$REPO_NAME:test
 
       - name: Login to Docker Hub
         uses: docker/login-action@v3