Merge pull request #76 from HideyoshiSolutions/fixes-cicd-timeout

Fixes CI/CD Timeout
This commit is contained in:
2024-02-14 03:01:04 -03:00
committed by GitHub
2 changed files with 47 additions and 45 deletions

View File

@@ -48,6 +48,7 @@ jobs:
username: ${{ secrets.SSH_USER }} username: ${{ secrets.SSH_USER }}
port: ${{ secrets.SSH_PORT }} port: ${{ secrets.SSH_PORT }}
key: ${{ secrets.SSH_KEY }} key: ${{ secrets.SSH_KEY }}
command_timeout: 1800s
script: | script: |
sudo apt update && sudo apt install -y jq sudo apt update && sudo apt install -y jq
source ~/.profile source ~/.profile

View File

@@ -1,54 +1,55 @@
name: remote ssh command name: remote ssh command
on: on:
push: push:
branches: branches:
- staging - staging
jobs: jobs:
build: build:
name: Build name: Build
environment: staging environment: staging
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 30 timeout-minutes: 30
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Set up Python 3.8 - name: Set up Python 3.8
uses: actions/setup-python@v3 uses: actions/setup-python@v3
with: with:
python-version: "3.10" python-version: "3.10"
- name: Create Config Json File - name: Create Config Json File
run: | run: |
echo "${{ secrets.CONFIG_JSON }}" | base64 -d > config.json echo "${{ secrets.CONFIG_JSON }}" | base64 -d > config.json
- name: Inserts Prod Enviromental Variables - name: Inserts Prod Enviromental Variables
run: | run: |
python -m pip install --upgrade pip pipenv python -m pip install --upgrade pip pipenv
pipenv install pipenv install
pipenv run python setup.py -e staging -f config.json pipenv run python setup.py -e staging -f config.json
- name: copy file via ssh - name: copy file via ssh
uses: appleboy/scp-action@master uses: appleboy/scp-action@master
with: with:
host: ${{ secrets.SSH_HOST }} host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }} username: ${{ secrets.SSH_USER }}
port: ${{ secrets.SSH_PORT }} port: ${{ secrets.SSH_PORT }}
key: ${{ secrets.SSH_KEY }} key: ${{ secrets.SSH_KEY }}
source: "." source: "."
target: "infra-hideyoshi.com" target: "infra-hideyoshi.com"
- name: executing remote ssh commands - name: executing remote ssh commands
uses: appleboy/ssh-action@master uses: appleboy/ssh-action@master
with: with:
host: ${{ secrets.SSH_HOST }} host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }} username: ${{ secrets.SSH_USER }}
port: ${{ secrets.SSH_PORT }} port: ${{ secrets.SSH_PORT }}
key: ${{ secrets.SSH_KEY }} key: ${{ secrets.SSH_KEY }}
script: | command_timeout: 1800s
sudo apt update && sudo apt install -y jq script: |
source ~/.profile sudo apt update && sudo apt install -y jq
cd infra-hideyoshi.com source ~/.profile
./deploy.sh --staging cd infra-hideyoshi.com
./refresh.sh ./deploy.sh --staging
./refresh.sh