Skip to content

More updates to first_test.yml #8

More updates to first_test.yml

More updates to first_test.yml #8

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Add ssh key for server access
uses: webfactory/[email protected]
with:
ssh-private-key: ${{secrets.APP_SSH_PRIVATE_KEY}}
- name: Add server to known_hosts
run: |
mkdir -p ~/.ssh/
touch ~/.ssh/known_hosts
chmod 600 ~/.ssh/known_hosts
ssh-keyscan ${{vars.APP_HOSTNAME}} >> ~/.ssh/known_hosts
- name: Get run filesystem
run: |
ucl_top=$(ssh ${{vars.APP_LOGIN}}@${{vars.APP_HOSTNAME}} "ksh -lc env | grep UCL_TOP| cut -d '=' -f 2")
echo "Found UCL_TOP filesystem ${ucl_top}"
echo "UCL_TOP=${ucl_top}" >> $GITHUB_ENV
xxsim_top=$(ssh ${{vars.APP_LOGIN}}@${{vars.APP_HOSTNAME}} "ksh -lc env | grep XXSIM_TOP| cut -d '=' -f 2")
echo "Found XXSIM_TOP filesystem ${xxsim_top}"
echo "XXSIM_TOP=${xxsim_top}" >> $GITHUB_ENV
# Runs a single command using the runners shell
- name: Run a one-line script
run: |
echo Hello, world!
echo ls
ls -lrt
echo whoami
whoami
# Runs a set of commands using the runners shell
- name: Run a multi-line script
run: |
echo Add other actions to build,
echo test, and deploy your project.
echo pwd
pwd
echo APP_HOSTNAME = ${{vars.APP_HOSTNAME}}