modify upload artifact #124
This file contains 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 to production | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14.17.6 | |
- run: npm install | |
- run: npm run build | |
- run: mv dist/celeste-search/robots.prod.txt dist/celeste-search/robots.txt | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist/celeste-search | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v1 | |
with: | |
name: dist | |
- name: Delete old files | |
uses: appleboy/ssh-action@v0.1.3 | |
with: | |
host: ${{ vars.DEPLOY_HOST }} | |
username: ${{ vars.DEPLOY_USERNAME }} | |
password: ${{ secrets.PASSWORD }} | |
port: ${{ vars.DEPLOY_PORT }} | |
script: | | |
cd ${{ vars.DEPLOY_TARGET_PROD }} | |
rm -rf * | |
- name: Upload files | |
uses: appleboy/scp-action@v0.1.3 | |
with: | |
host: ${{ vars.DEPLOY_HOST }} | |
username: ${{ vars.DEPLOY_USERNAME }} | |
password: ${{ secrets.PASSWORD }} | |
port: ${{ vars.DEPLOY_PORT }} | |
strip_components: 1 | |
source: "dist" | |
target: "${{ vars.DEPLOY_TARGET_PROD }}" |