Parcourir la source

publish to docker hub github action

dev_h
Ophir LOJKINE il y a 3 ans
Parent
révision
5a7419ca49
2 fichiers modifiés avec 38 ajouts et 20 suppressions
  1. 38
    0
      .github/workflows/deploy.yml
  2. 0
    20
      .github/workflows/ssh_deploy.yml

+ 38
- 0
.github/workflows/deploy.yml Voir le fichier

@@ -0,0 +1,38 @@
1
+name: deploy
2
+on:
3
+  push:
4
+    tags:        
5
+      - v*
6
+
7
+jobs:
8
+  build:
9
+    name: deploy
10
+    runs-on: ubuntu-latest
11
+    steps:
12
+    - uses: actions/checkout@v2
13
+      with:
14
+        fetch-depth: 0
15
+    - name: Dokku
16
+      uses: dokku/github-action@9c1a871eab9daef563cf08b9602c7675f4a8bb56
17
+      with:
18
+        git_remote_url: ssh://dokku@${{ secrets.SSH_SERVER }}:22/wbo
19
+        ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
20
+        git_push_flags: --force
21
+  push_to_registry:
22
+    name: Push Docker image to Docker Hub
23
+    runs-on: ubuntu-latest
24
+    steps:
25
+      - name: Check out the repo
26
+        uses: actions/checkout@v2
27
+      - name: Set env
28
+        run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
29
+      - name: Log in to Docker Hub
30
+        uses: docker/login-action@v1
31
+        with:
32
+          username: lovasoa
33
+          password: ${{ secrets.DOCKER_PASSWORD }}
34
+      - name: Push to Docker Hub
35
+        uses: docker/build-push-action@v2
36
+        with:
37
+          push: true
38
+          tags: lovasoa/wbo:latest,lovasoa/wbo:${{ env.RELEASE_VERSION }}

+ 0
- 20
.github/workflows/ssh_deploy.yml Voir le fichier

@@ -1,20 +0,0 @@
1
-name: ssh deploy
2
-on:
3
-  push:
4
-    tags:        
5
-      - v*
6
-
7
-jobs:
8
-  build:
9
-    name: deploy
10
-    runs-on: ubuntu-latest
11
-    steps:
12
-    - uses: actions/checkout@v2
13
-      with:
14
-        fetch-depth: 0
15
-    - name: Dokku
16
-      uses: dokku/github-action@9c1a871eab9daef563cf08b9602c7675f4a8bb56
17
-      with:
18
-        git_remote_url: ssh://dokku@${{ secrets.SSH_SERVER }}:22/wbo
19
-        ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
20
-        git_push_flags: --force

Chargement…
Annuler
Enregistrer