Skip to content

Commit

Permalink
update:githubaction
Browse files Browse the repository at this point in the history
  • Loading branch information
kaoru-528 committed Oct 27, 2024
1 parent f205c16 commit cb15c4a
Showing 1 changed file with 4 additions and 47 deletions.
51 changes: 4 additions & 47 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,50 +21,7 @@ jobs:
script: |
cd ./www/book_log_list
git pull origin main
# steps:
# - name: Checkout code
# uses: actions/checkout@v2

# - name: Set up Ruby
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: 3.2.3 # 使用するRubyのバージョンを指定
# bundler-cache: true # Bundlerのキャッシュを有効に

# - name: Install dependencies
# run: |
# gem install bundler
# bundle install

# - name: Set environment variables
# env:
# SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
# BOOK_LOG_LIST_DATABASE_USER: ${{ secrets.BOOK_LOG_LIST_DATABASE_USER }}
# BOOK_LOG_LIST_DATABASE_PASSWORD: ${{ secrets.BOOK_LOG_LIST_DATABASE_PASSWORD }}
# DATABASE_HOST: ${{ secrets.DATABASE_HOST }}
# run: |
# echo "SECRET_KEY_BASE set"
# echo "BOOK_LOG_LIST_DATABASE_USER set"
# echo "BOOK_LOG_LIST_DATABASE_PASSWORD set"
# echo "DATABASE_HOST set"

# - name: Run migrations
# env:
# SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
# BOOK_LOG_LIST_DATABASE_USER: ${{ secrets.BOOK_LOG_LIST_DATABASE_USER }}
# BOOK_LOG_LIST_DATABASE_PASSWORD: ${{ secrets.BOOK_LOG_LIST_DATABASE_PASSWORD }}
# DATABASE_HOST: ${{ secrets.DATABASE_HOST }}
# run: |
# bundle exec rails db:migrate RAILS_ENV=production

# - name: Deploy to Server
# env:
# SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
# USER: ${{ secrets.SSH_USER }}
# HOST: ${{ secrets.SSH_HOST }}
# SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }}
# run: |
# echo "$SSH_PRIVATE_KEY" > private_key.pem
# chmod 600 private_key.pem
# ssh -o StrictHostKeyChecking=no -i private_key.pem $USER@$HOST "cd /home/ubuntu/www/book_log_list && git pull origin main && bundle install && RAILS_ENV=production bundle exec rake db:migrate && puma -C config/puma.rb -e production"
bundle install
RAILS_ENV=production
bundle exec rake db:migrate
puma -C config/puma.rb -e production -d

0 comments on commit cb15c4a

Please sign in to comment.