Deploy #4043
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 | |
on: | |
push: | |
branches: | |
- master | |
schedule: | |
- cron: '0 5,6,7,9 * * *' | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Setup Node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '14.x' | |
- name: Cache dependencies Node | |
uses: actions/cache@v1 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: ${{ runner.os }}-node- | |
- name: Install | |
run: npm ci | |
# - name: Write Version | |
# run: npm run version | |
- name: Fetch Data | |
run: npm run data | |
# temporary | |
- name: Commit files # commit the output folder | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "Andre Robot" | |
git add . | |
git commit -m "Add generated data" | |
- name: Push changes # push the output folder to your repo | |
uses: ad-m/github-push-action@master | |
with: | |
branch: master #ignore if your branch is master | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
force: true | |
- name: Build Svelte | |
run: npm run export | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./__sapper__/export | |
- name: FTP Upload | |
uses: SamKirkland/[email protected] | |
with: | |
server: ${{ secrets.FTP_SERVER }} | |
username: ${{ secrets.FTP_USERNAME }} | |
password: ${{ secrets.FTP_PASSWORD }} | |
local-dir: ./__sapper__/export/ | |
server-dir: corona-ampel-coburg.de/ | |
- name: Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: json-artifact | |
path: src/routes/_data.js |