Created
May 5, 2021 10:35
-
-
Save stow1x/4cecd08fc0f993a608d19dc6a87403ed to your computer and use it in GitHub Desktop.
GitHub Deploy & Actions
This file contains hidden or 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: 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 . [email protected]:/var/www/pepelsbey.dev/html/ |
This file contains hidden or 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: 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 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Need to create folder in your project
.github/workflow/.