Skip to content

Instantly share code, notes, and snippets.

@xelinel32
Created May 5, 2021 10:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xelinel32/4cecd08fc0f993a608d19dc6a87403ed to your computer and use it in GitHub Desktop.
Save xelinel32/4cecd08fc0f993a608d19dc6a87403ed to your computer and use it in GitHub Desktop.
GitHub Deploy & Actions
name: Deploy
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
# Setup key
- run: set -eu
- run: mkdir "$HOME/.ssh"
- run: echo "${{ secrets.key }}" > "$HOME/.ssh/key"
- run: chmod 600 "$HOME/.ssh/key"
# Build
- run: npm ci
- run: npm run build
# Deploy
- run: cd dist && rsync -e "ssh -i $HOME/.ssh/key -o StrictHostKeyChecking=no" --archive --compress --delete . pepelsbey@pepelsbey.dev:/var/www/pepelsbey.dev/html/
name: Test
on:
pull_request:
push:
branches:
- master
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
@xelinel32
Copy link
Author

xelinel32 commented May 5, 2021

Need to create folder in your project .github/workflow/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment