fix: head (#111) #104
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: Build and Deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Install dependencies | |
run: npm ci | |
- name: Set timezone | |
uses: szenius/[email protected] | |
with: | |
timezoneLinux: "Europe/Paris" | |
timezoneMacos: "Europe/Paris" | |
timezoneWindows: "Paris Standard Time" | |
- name: Set build date | |
run: echo 'BUILD_DATE="'$(date '+%Y-%m-%dT%H:%M:00')'"' > .env | |
- name: Build | |
run: npm run build | |
- name: add robots.txt | |
run: echo 'User-agent:*' > ./dist/robots.txt && echo 'Disallow:' >> ./dist/robots.txt | |
- name: copy file via ssh password | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.SSHKEY }} | |
port: ${{ secrets.PORT }} | |
source: ./dist/* | |
target: ${{ secrets.SERVER_FOLDER }} | |
strip_components: 1 | |
rm: true | |