Skip to content

Dev #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Dev #163

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: sms-frontend workflow

on:
push:
branches:
- dev

jobs:
deploy:
runs-on: self-hosted
steps:
- name: SSH and deploy for frontend
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.PORT }}
script: |
cd simple-node-js-react-npm-app
git pull https://${{ secrets.USERNAME_GIT }}:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/annas-whizpool/simple-node-js-react-npm-app.git dev
ls -la
27 changes: 27 additions & 0 deletions .github/workflows/rollback.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Rollback testing

on:
workflow_dispatch:
inputs:
commit_hash:
description: 'Commit hash to rollback to'
required: true
default: ''
# Only allow running this from the development branch button will only appear when the development branch is selected

jobs:
rollback-backend:
runs-on: self-hosted
steps:
- name: SSH and deploy for frontend
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.PORT }}
script: |
cd simple-node-js-react-npm-app
COMMIT_HASH="${{ github.event.inputs.commit_hash }}"
echo "Resetting to specific commit $COMMIT_HASH..."
git reset --hard $COMMIT_HASH
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ check that the application renders satisfactorily.
The `jenkins` directory contains an example of the `Jenkinsfile` (i.e. Pipeline)
you'll be creating yourself during the tutorial and the `scripts` subdirectory
contains shell scripts with commands that are executed when Jenkins processes
the "Test" and "Deliver" stages of your Pipeline.
the "Test" and "Deliver" stages of your Pipeline.1234