-
Notifications
You must be signed in to change notification settings - Fork 0
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
393c501
commit dde239f
Showing
1 changed file
with
60 additions
and
60 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 |
---|---|---|
@@ -1,64 +1,64 @@ | ||
# name: Build on DockerHub and Deploy to OVH Cloud | ||
# on: | ||
# push: | ||
# branches: | ||
# - main | ||
# env: | ||
# DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
# DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | ||
# jobs: | ||
# build: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Checkout code | ||
# uses: actions/checkout@v4 | ||
# - name: Set up Docker Buildx | ||
# uses: docker/setup-buildx-action@v3 | ||
# - name: Login to DockerHub | ||
# uses: docker/login-action@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
# password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
# - name: Build and push Docker image | ||
# uses: docker/build-push-action@v5 | ||
# with: | ||
# context: ./ | ||
# push: true | ||
# dockerfile: ./Dockerfile | ||
# tags: nguyenhau2003/mindustry-gpt:latest | ||
name: Build on DockerHub and Deploy to OVH Cloud | ||
on: | ||
push: | ||
branches: | ||
- main | ||
env: | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./ | ||
push: true | ||
dockerfile: ./Dockerfile | ||
tags: nguyenhau2003/mindustry-gpt:latest | ||
|
||
|
||
# deploy: | ||
# needs: build | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v4 | ||
# - name: Login to Docker Hub | ||
# uses: docker/login-action@v3 | ||
# with: | ||
# username: ${{ env.DOCKERHUB_USERNAME }} | ||
# password: ${{ env.DOCKERHUB_TOKEN }} | ||
# deploy: | ||
# needs: build | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Checkout | ||
# uses: actions/checkout@v4 | ||
# - name: Login to Docker Hub | ||
# uses: docker/login-action@v3 | ||
# with: | ||
# username: ${{ env.DOCKERHUB_USERNAME }} | ||
# password: ${{ env.DOCKERHUB_TOKEN }} | ||
|
||
# - name: copy files to target server via scp | ||
# uses: appleboy/scp-action@v0.1.3 | ||
# with: | ||
# host: ${{ secrets.OVH_CLOUD_IP }} | ||
# username: ${{ secrets.OVH_CLOUD_USERNAME }} | ||
# password: ${{ secrets.OVH_CLOUD_PASSWORD }} | ||
# source: "./docker-compose.yml" | ||
# target: "~/.deploy/${{github.event.repository.name }}/" | ||
# - name: copy files to target server via scp | ||
# uses: appleboy/scp-action@v0.1.3 | ||
# with: | ||
# host: ${{ secrets.OVH_CLOUD_IP }} | ||
# username: ${{ secrets.OVH_CLOUD_USERNAME }} | ||
# password: ${{ secrets.OVH_CLOUD_PASSWORD }} | ||
# source: "./docker-compose.yml" | ||
# target: "~/.deploy/${{github.event.repository.name }}/" | ||
|
||
# - name: Pull image | ||
# uses: appleboy/ssh-action@v1.0.3 | ||
# with: | ||
# host: ${{ secrets.OVH_CLOUD_IP }} | ||
# username: ${{ secrets.OVH_CLOUD_USERNAME }} | ||
# password: ${{ secrets.OVH_CLOUD_PASSWORD }} | ||
# context: ./ | ||
# script: | | ||
# sudo docker login --username nguyenhau2003 -p ${{ env.DOCKERHUB_TOKEN }} | ||
# cd ~/.deploy/${{github.event.repository.name}} | ||
# sudo docker compose -f ./docker-compose.yml pull | ||
# sudo docker rm -f mindustry-gpt | ||
# sudo docker compose -f ./docker-compose.yml -p mindustry-gpt up -d | ||
# # - name: Pull image | ||
# # uses: appleboy/ssh-action@v1.0.3 | ||
# # with: | ||
# # host: ${{ secrets.OVH_CLOUD_IP }} | ||
# # username: ${{ secrets.OVH_CLOUD_USERNAME }} | ||
# # password: ${{ secrets.OVH_CLOUD_PASSWORD }} | ||
# # context: ./ | ||
# # script: | | ||
# # sudo docker login --username nguyenhau2003 -p ${{ env.DOCKERHUB_TOKEN }} | ||
# # cd ~/.deploy/${{github.event.repository.name}} | ||
# # sudo docker compose -f ./docker-compose.yml pull | ||
# # sudo docker rm -f mindustry-gpt | ||
# # sudo docker compose -f ./docker-compose.yml -p mindustry-gpt up -d |