Skip to content

Commit

Permalink
add: github action
Browse files Browse the repository at this point in the history
  • Loading branch information
tvc12 committed Jun 16, 2021
1 parent 29888b4 commit 54bb2c7
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/docker-publish-release-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test, Publish, & Release
on: [push]
jobs:
publish:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: |
4petsocial/landing-page:latest
4petsocial/landing-page:0.7.0
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
create-release:
needs: publish
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@master
- uses: Roang-zero1/github-create-release-action@master
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
deployment:
needs: publish
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: executing remote ssh commands using password
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: cd deployment/prod-env && docker-compose pull && ./scripts/rebuild.sh

0 comments on commit 54bb2c7

Please sign in to comment.