KenyaEMR 18.6.2 03 Platform upgrade #25
Workflow file for this run
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: KenyaEMR CI | |
'on': | |
push: | |
branches: | |
- main | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: | |
- 18.x | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 'Use Node.js ${{ matrix.node-version }}' | |
uses: actions/setup-node@v3 | |
- uses: actions/checkout@v2 | |
- name: Run script file | |
run: | | |
chmod +x ./dev-build.sh | |
sh ./dev-build.sh | |
shell: bash | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: frontend | |
path: | | |
frontend | |
- name: Upload frontend to server | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.CICD_HOST }} | |
username: ${{ secrets.CICD_USERNAME }} | |
port: ${{ secrets.PORT }} | |
key: ${{ secrets.CICD_SECRET }} | |
source: ./frontend/ | |
target: /apps/githubworkflows/OpenMrs3.0_assets | |
- name: executing remote ssh commands using password | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.CICD_HOST }} | |
username: ${{ secrets.CICD_USERNAME }} | |
port: ${{ secrets.PORT }} | |
key: ${{ secrets.CICD_SECRET }} | |
script: >- | |
sudo mv /var/lib/OpenMRS/frontend /var/lib/OpenMRS/frontend_old && mv | |
/apps/githubworkflows/OpenMrs3.0_assets/frontend /var/lib/OpenMRS/ && sudo rm -rf | |
/var/lib/OpenMRS/frontend_old | |
release: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' | |
strategy: | |
matrix: | |
node-version: | |
- 18.x | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 'Use Node.js ${{ matrix.node-version }}' | |
uses: actions/setup-node@v3 | |
- name: Run production build script | |
run: | | |
chmod +x ./prod-build.sh | |
sh ./prod-build.sh | |
shell: bash | |
- name: Upload release artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: frontend | |
path: | | |
frontend |