-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1c4380e
commit cb203ad
Showing
1 changed file
with
8 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,24 +19,11 @@ jobs: | |
- name: Pull MySQL image from Docker Hub | ||
run: docker pull mysql:latest | ||
|
||
- name: Save Docker image to a tar file | ||
run: docker save mysql:latest -o mysql_latest.tar | ||
|
||
- name: Copy Docker image to remote server | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.REMOTE_HOST }} | ||
username: ${{ secrets.REMOTE_USER }} | ||
password: ${{ secrets.REMOTE_PASSWORD }} | ||
source: mysql_latest.tar | ||
target: /tmp/mysql_latest.tar | ||
|
||
- name: Load Docker image on remote server | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.REMOTE_HOST }} | ||
username: ${{ secrets.REMOTE_USER }} | ||
password: ${{ secrets.REMOTE_PASSWORD }} | ||
script: | | ||
docker load -i /tmp/mysql_latest.tar | ||
# docker run -d --name mysql_container -e MYSQL_ROOT_PASSWORD=root mysql:latest | ||
- name: Tag MySQL image for private registry | ||
run: docker tag mysql:latest 116.198.201.187:5000/mysql:latest | ||
|
||
- name: Log in to private Docker registry | ||
run: docker login 116.198.201.187:5000 | ||
|
||
- name: Push MySQL image to private registry | ||
run: docker push 116.198.201.187:5000/mysql:latest |