Last active
February 3, 2021 20:45
-
-
Save benawad/fd5a95db905b0918101c724fdebf159b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
steps: | |
- uses: actions/checkout@v2 | |
- run: yarn install | |
- run: yarn test | |
- run: yarn docker:build | |
- run: yarn docker:login | |
env: | |
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- run: yarn docker:push | |
# this action will ssh into VPS then run 3 commands: | |
# docker pull name/label:latest => pull image from docker | |
# docker tag name/label:latest dokku/prod:latest => tag image (this is needed for dokku) | |
# dokku tags:deploy prod latest => dokku deploys that docker image | |
- name: deploy to dokku | |
uses: fifsky/ssh-action@master | |
with: | |
command: docker pull name/label:latest && docker tag name/label:latest dokku/prod:latest && dokku tags:deploy prod latest | |
host: ${{ secrets.SSH_HOST }} | |
user: ${{ secrets.SSH_USER }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts":{ | |
"docker:build":"docker build -t name/label:latest .", | |
"docker:login":"docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD", | |
"docker:push":"docker push name/label:latest" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment