diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0247875..fc37a42 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -16,29 +16,31 @@ jobs: - name: Login to DockerHub Registry run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin - name: Build Docker image - run: docker build -t dmitrydorofeev/godeploy:${GITHUB_SHA::8} . + run: docker build -t dmitrydorofeev/godeploy:${GITHUB_SHA::8} -t dmitrydorofeev/godeploy:latest . - name: Push the image - run: docker push dmitrydorofeev/godeploy:${GITHUB_SHA::8} + run: | + docker push dmitrydorofeev/godeploy:${GITHUB_SHA::8} + docker push dmitrydorofeev/godeploy:latest - deploy: - runs-on: ubuntu-latest - needs: build - steps: - - name: pull docker image - uses: appleboy/ssh-action@master - with: - envs: GITHUB_SHA - host: 37.139.41.28 - username: ubuntu - key: ${{ secrets.PRIVATE_KEY }} - script: sudo docker pull dmitrydorofeev/godeploy:${GITHUB_SHA::8} - - name: deploy docker image - uses: appleboy/ssh-action@master - with: - envs: GITHUB_SHA - host: 37.139.41.28 - username: ubuntu - key: ${{ secrets.PRIVATE_KEY }} - script: | - sudo docker rm -f $(sudo docker ps -aq) - sudo docker run -e VERSION=${GITHUB_SHA::8} -d -p 8080:8080 dmitrydorofeev/godeploy:${GITHUB_SHA::8} + # deploy: + # runs-on: ubuntu-latest + # needs: build + # steps: + # - name: pull docker image + # uses: appleboy/ssh-action@master + # with: + # envs: GITHUB_SHA + # host: 37.139.41.28 + # username: ubuntu + # key: ${{ secrets.PRIVATE_KEY }} + # script: sudo docker pull dmitrydorofeev/godeploy:${GITHUB_SHA::8} + # - name: deploy docker image + # uses: appleboy/ssh-action@master + # with: + # envs: GITHUB_SHA + # host: 37.139.41.28 + # username: ubuntu + # key: ${{ secrets.PRIVATE_KEY }} + # script: | + # sudo docker rm -f $(sudo docker ps -aq) + # sudo docker run -e VERSION=${GITHUB_SHA::8} -d -p 8080:8080 dmitrydorofeev/godeploy:${GITHUB_SHA::8}