From 593363a42bf7cfa6f3c4d5eb7c7d68feae28d09f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Fri, 3 Jul 2020 23:58:32 +0200 Subject: [PATCH] Adding GH pages build to optimize maps --- .github/workflows/build-and-deploy.yml | 40 ++++++++++++++++++++++++++ README.md | 7 +++-- 2 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build-and-deploy.yml diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml new file mode 100644 index 0000000..e7227b2 --- /dev/null +++ b/.github/workflows/build-and-deploy.yml @@ -0,0 +1,40 @@ +name: Optimize map and deploy + +on: + push: + branches: + - master + +jobs: + + deploy: + + runs-on: ubuntu-latest + + steps: + + - name: Checkout + uses: actions/checkout@v2 + + - name: Optimize map + uses: thecodingmachine/map-optimizer-action@master + + - name: Bash + run: | + ls -al + git config --global user.email "d.negrier@thecodingmachine.com" + git config --global user.name "David NĂ©grier" + git checkout master + git commit -am "Adding files" + + - name: Deploy + uses: JamesIves/github-pages-deploy-action@releases/v3 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages # The branch the action should deploy to. + FOLDER: . # The folder the action should deploy. + BASE_BRANCH: master + + - name: Bash2 + run: | + ls -al diff --git a/README.md b/README.md index e2d659e..2dc9998 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ click the **"Use this template"** button. You will be prompted to enter a reposi Be sure to keep the repository "Public". In your newly created repository, click on the **Settings tab** and scroll down to the **GitHub Pages** section. -Then select the **master** branch. +Then select the **gh-pages** branch. ![](docs/github_pages.png) @@ -38,7 +38,7 @@ Your map is now up and online. You need to customize it. ### Cloning the map Start by cloning the map. If you are used to Git and GitHub, simply clone the map -to your computer using your preferred tool and jump to the next chapter. +to your computer using your preferred tool and [jump to the next chapter](#loading-the-map-in-tiled). If you are new to Git, cloning the map means downloading the map to your computer. To do this, you will need Git, or a Git compatible tool. Our advice is to use @@ -74,3 +74,6 @@ Please be sure to check it out. ### Pushing the map When your changes are ready, you need to "commit" and "push" the changes back to GitHub. +Just wait a few minutes, and your map will be propagated automatically to the GitHub pages web-server. + +TODO: describe how to push