KENYAEMR3.x_v1.10.1_WED-08-NOV-2023 #11
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 OpenMRS React forms | |
'on': | |
push: | |
branches: | |
- react-forms | |
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-react-forms-build.sh | |
sh ./dev-react-forms-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/ohri_openmrs8700 | |
- 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: >- | |
${{ secrets.DOCKER8700 }} | |
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 | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./frontend.zip | |
asset_name: frontend | |
asset_content_type: application/ |