Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Merge pull request #98 from AllInOpenSource/coming-soon-page #247

Merge pull request #98 from AllInOpenSource/coming-soon-page

Merge pull request #98 from AllInOpenSource/coming-soon-page #247

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches:
- "*"
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [19.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: npm test
- run: npm run build
- name: Upload Build Artifact
uses: actions/upload-artifact@v2
with:
name: build
path: build
deploy:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- uses: actions/checkout@v3
- name: Download Build Artifact
uses: actions/download-artifact@v3
with:
name: build
path: build
- name: remove old build
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DROPLET_IP_ADDRESS }}
username: ${{ secrets.SSHUSERNAME }}
password: ${{ secrets.SSHPASSWORD }}
script: |
echo ${{ secrets.SSHPASSWORD }} | sudo -S rm -rf /var/www/badging.allinopensource.org/*
mkdir -p /var/www/badging.allinopensource.org/
- name: deploy new build
uses: garygrossgarten/github-action-scp@release
with:
host: ${{ secrets.DROPLET_IP_ADDRESS }}
username: ${{ secrets.SSHUSERNAME }}
password: ${{ secrets.SSHPASSWORD }}
local: ${{ github.workspace }}/build
remote: "/var/www/badging.allinopensource.org/"
- name: restart nginx
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DROPLET_IP_ADDRESS }}
username: ${{ secrets.SSHUSERNAME }}
password: ${{ secrets.SSHPASSWORD }}
script: |
echo ${{ secrets.SSHPASSWORD }} | sudo -S systemctl restart nginx