Copy github workflows
This commit is contained in:
54
.github/workflows/release.yml
vendored
Normal file
54
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
name: Release Pipeline
|
||||
|
||||
on:
|
||||
workflow_dispatch: # Allows manual triggering
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Release to Server
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# Step 1: Checkout the code
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Step 2: Download build artifacts from another workflow (e.g., build pipeline)
|
||||
- name: Download Frontend Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: frontend # Name of the artifact created in the build pipeline
|
||||
path: ./artifact # Where to download the artifact
|
||||
|
||||
# Step 2: Download build artifacts from another workflow (e.g., build pipeline)
|
||||
- name: Download Backend Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: backend # Name of the artifact created in the build pipeline
|
||||
path: ./artifact # Where to download the artifact
|
||||
|
||||
# Step 3: Replace tokens in files with GitHub secrets
|
||||
#- name: Replace tokens in files
|
||||
# run: |
|
||||
# find ./artifact -type f -exec sed -i "s/{{TOKEN_SECRET}}/${{ secrets.TOKEN_SECRET }}/g" {} \;
|
||||
|
||||
# Step 4: Compress the artifact folder
|
||||
#- name: Compress files
|
||||
# run: |
|
||||
# tar -czvf release_artifact.tar.gz -C ./artifact .
|
||||
|
||||
# Step 5: Set up SSH agent with the private key
|
||||
#- name: Setup SSH
|
||||
# uses: webfactory/ssh-agent@v0.5.4
|
||||
# with:
|
||||
# ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
|
||||
# Step 6: Upload the compressed file to the remote server via SCP
|
||||
#- name: Upload to remote server
|
||||
# run: |
|
||||
# scp release_artifact.tar.gz ${{ secrets.REMOTE_USER }}@${{ secrets.REMOTE_HOST }}:/path/to/destination
|
||||
|
||||
# Step 7: Execute a script on the remote server
|
||||
#- name: Execute remote script
|
||||
# run: |
|
||||
# ssh ${{ secrets.REMOTE_USER }}@${{ secrets.REMOTE_HOST }} "bash /path/to/destination/deploy.sh"
|
||||
Reference in New Issue
Block a user