Compare commits
5 Commits
9366d29202
...
e71a72bff9
Author | SHA1 | Date |
---|---|---|
Emilia Allison | e71a72bff9 | |
Emilia Allison | 430d0aa845 | |
Emilia Allison | bf09f281b3 | |
Emilia Allison | ca5c15756e | |
Emilia Allison | 95b81a7858 |
|
@ -0,0 +1,24 @@
|
|||
name: Beta Deploy
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- beta-release
|
||||
|
||||
jobs:
|
||||
Compile-Plate-Tool:
|
||||
runs-on: linux_arm
|
||||
steps:
|
||||
- name: Check out repo code
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
with:
|
||||
ref: "beta-release"
|
||||
- name: Compile plate-tool
|
||||
run: |
|
||||
. "$HOME/.cargo/env"
|
||||
trunk build --release --public-url "cool-stuff/plate-tool-beta/"
|
||||
- name: Transfer files to host server
|
||||
run: |
|
||||
sftp oracle <<< "put -r dist"
|
||||
- name: Deploy plate-tool-beta on host server
|
||||
run: |
|
||||
ssh oracle "sudo rm -rf /usr/share/nginx/html/plate-tool-beta/ && sudo mv dist /usr/share/nginx/html/plate-tool-beta"
|
|
@ -0,0 +1,48 @@
|
|||
pipeline {
|
||||
agent any
|
||||
environment {
|
||||
OUTPUT_DIR = "${env.BRANCH_NAME == "main" ? "plate-tool" : "plate-tool-beta"}"
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Parent') {
|
||||
when { anyOf { branch 'main'; branch 'beta-release' } }
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh '''
|
||||
. "$HOME/.cargo/env"
|
||||
trunk build --release --public-url "cool-stuff/$OUTPUT_DIR/"
|
||||
'''
|
||||
}
|
||||
}
|
||||
stage('Archive') {
|
||||
steps {
|
||||
zip zipFile: "dist.zip", archive: true, dir: "dist/"
|
||||
archiveArtifacts artifacts: "dist.zip", fingerprint: true
|
||||
}
|
||||
}
|
||||
stage('Transfer') {
|
||||
steps {
|
||||
sh 'echo "put -r dist/" | sftp oracle'
|
||||
}
|
||||
}
|
||||
stage('Deploy') {
|
||||
steps {
|
||||
sh '''
|
||||
ssh oracle "sudo rm -rf /usr/share/nginx/html/$OUTPUT_DIR/ && sudo mv dist /usr/share/nginx/html/$OUTPUT_DIR"
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
cleanWs(notFailBuild: true,
|
||||
deleteDirs: true,
|
||||
cleanWhenNotBuilt: false,
|
||||
patterns: [[pattern: 'target/', type: 'EXCLUDE']])
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue