Github Actions Deployment on 2 servers #45884
Replies: 3 comments 2 replies
-
pseudo code example -> you must test and verify I have not run. @goldyrocky name: Deploy to servers
on:
push:
branches:
- main
env:
DEPLOY_HOST1: example.com
DEPLOY_HOST2: another-example.com
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build the application
run: |
# commands to build the application
- name: Deploy to first server
env:
DEPLOY_HOST: ${{ env.DEPLOY_HOST1 }}
run: |
# commands to deploy the build to the first server
- name: Deploy to second server
env:
DEPLOY_HOST: ${{ env.DEPLOY_HOST2 }}
run: |
# commands to deploy the build to the second server |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
Hi Devs,
How can I deploy same build on 2 different servers with github actions. On one server builds can be pushed and working fine but I want to push the same build to another server as well.
Please help.
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions