Deploy #25
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
name: Deploy | |
on: | |
workflow_run: | |
workflows: ['CI/CD'] | |
types: | |
- completed | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Frontend Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: frontend-build | |
path: frontend/dist | |
- name: Download Backend Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: backend-build | |
path: backend/dist | |
- name: Deploy to Production | |
env: | |
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} | |
DEPLOY_URL: ${{ secrets.DEPLOY_URL }} | |
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
run: | | |
# Add your deployment commands here | |
# For example: | |
# - Deploy to AWS | |
# - Deploy to Google Cloud | |
# - Deploy to Azure | |
# - Deploy to Digital Ocean | |
echo "Deploying to production..." | |
- name: Notify Success | |
if: success() | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.ACCESS_TOKEN }} | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: '🚀 Deployment successful!' | |
}) | |
- name: Notify Failure | |
if: failure() | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.ACCESS_TOKEN }} | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: '❌ Deployment failed!' | |
}) |