Files
portfolio/.github/workflows/deploy.yml
Workflow config file is invalid. Please check your config file: yaml: unmarshal errors: line 36: cannot unmarshal !!seq into string

59 lines
1.5 KiB
YAML

name: Deploy to server
on:
push:
branches:
- main
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install dependencies and build
run: |
npm ci
npm run build
- name: Create GitHub deployment
id: create_deployment
uses: octokit/request-action@v2.x
with:
route: POST /repos/${{ github.repository }}/deployments
ref: ${{ github.sha }}
environment: production
required_contexts: []
- name: Copy build directory to server
uses: Dylan700/sftp-upload-action@v1.2.3
with:
server: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
port: ${{ secrets.SERVER_PORT }}
uploads: |
./dist => /webroot/
delete: true
- name: Update GitHub deployment status
if: success()
uses: octokit/request-action@v2.x
with:
route: POST /repos/${{ github.repository }}/deployments/${{ steps.create_deployment.outputs.data.id }}/statuses
state: success
environment: production
environment_url: https://mrqt.fr
log_url: https://mrqt.fr
description: Deployment succeeded
auto_inactive: true