Docker Build & Deploy #1155
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: Docker Build & Deploy | |
on: | |
schedule: | |
- cron: '0 9 * * *' | |
workflow_dispatch: | |
# push: | |
# # Run `master` as Docker `latest` image. | |
# branches: [ master ] | |
jobs: | |
build: | |
name: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build mbtiles | |
env: | |
db_user: ${{ secrets.DB_USER }} | |
db_password: ${{ secrets.DB_PASSWORD }} | |
db_host: ${{ secrets.DB_HOST }} | |
db_port: ${{ secrets.DB_PORT }} | |
db_name: ${{ secrets.DB_NAME }} | |
run: docker-compose up | |
- name: Push mbtiles to github | |
if: ${{ github.ref == 'refs/heads/master' }} | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
run: | | |
git config --global user.name "nawasco+githubci" | |
git config --global user.email "nawasco+githubci@users.noreply.github.com" | |
git remote set-url origin https://x-access-token:${NODE_AUTH_TOKEN}@github.com/nawasco/vt.git | |
git add . | |
git commit -m "update vectortiles" | |
git push origin master | |
- name: Deploy 🚀 | |
uses: JamesIves/github-pages-deploy-action@4.1.7 | |
if: ${{ github.ref == 'refs/heads/master' }} | |
with: | |
branch: gh-pages # The branch the action should deploy to. | |
folder: public # The folder the action should deploy. |