This commit is contained in:
parent
fa973a8204
commit
5b5494108c
47
.github/workflows/ci.yml
vendored
Normal file
47
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
# 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:
|
||||||
|
git_remote_url: 'ssh://dokku@heroku.ctdn.net:2222/spring-web-modules'
|
||||||
|
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
branch: main
|
||||||
|
git_push_flags: --force
|
@ -6,6 +6,6 @@ APP_PROFILE=demo
|
|||||||
VERSION=demo
|
VERSION=demo
|
||||||
IMAGE=spring-web-api
|
IMAGE=spring-web-api
|
||||||
CONTAINER=$IMAGE
|
CONTAINER=$IMAGE
|
||||||
REGISTRY=registry.kh.cubetiqs.com
|
REGISTRY=registry.ctdn.net
|
||||||
EXPOSE_PORT=8080
|
EXPOSE_PORT=8080
|
||||||
ROOT_HUB=$REGISTRY/$IMAGE:$VERSION
|
ROOT_HUB=$REGISTRY/$IMAGE:$VERSION
|
Loading…
Reference in New Issue
Block a user