2022-10-03 08:35:12 +07:00
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name : CI
on :
push :
branches : [ 'main' ]
pull_request :
branches : [ 'main' ]
jobs :
build :
runs-on : ubuntu-latest
steps :
- uses : actions/checkout@v3
- name : Login to Docker Hub
uses : docker/login-action@v2
with :
registry : ${{ secrets.DOCKER_REGISTRY }}
username : ${{ secrets.DOCKER_USERNAME }}
password : ${{ secrets.DOCKER_PASSWORD }}
- uses : actions/checkout@v3
- name : Build the Docker image
run : |
docker build . --file Dockerfile --tag registry.ctdn.net/spring-web-api:latest
docker push registry.ctdn.net/spring-web-api:latest
deploy :
runs-on : self-hosted
steps :
- name : Cloning repo
uses : actions/checkout@v3
with :
fetch-depth : 0
- name : Push to dokku
uses : dokku/github-action@master
with :
2023-03-09 19:07:28 +07:00
git_remote_url : 'ssh://dokku@heroku.ctdn.net:2222/spring-web-api-demo'
2022-10-03 08:35:12 +07:00
ssh_private_key : ${{ secrets.SSH_PRIVATE_KEY }}
branch : main
git_push_flags : --force