diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7539cef..73b7eac 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,12 @@ -image: barichello/godot-ci:3.1.1 +image: barichello/godot-ci:3.1.2 stages: - export - deploy +variables: + EXPORT_NAME: game-off + before_script: - mkdir -v -p build/linux - mkdir -v -p build/windows @@ -46,7 +49,7 @@ web: paths: - build/web -# Use project root to deploy for the gh-pages branch +# GitHub Pages Deploy deploy-github-pages: stage: deploy dependencies: @@ -61,3 +64,16 @@ deploy-github-pages: - git add -A - 'git commit -m "ci: Deploy GitHub Page $EXPORT_NAME-$CI_JOB_NAME$" -m "Deploy from GitLab pipeline \#$CI_PIPELINE_ID"' - git push github gh-pages -f + +# GitLab Pages Deploy +pages: + stage: deploy + dependencies: + - web + script: + - git checkout pages + - rm -f *.md + - mv build/web/** ./public + artifacts: + paths: + - public diff --git a/README.md b/README.md index 8ee2840..18afade 100644 --- a/README.md +++ b/README.md @@ -14,13 +14,20 @@ A `.gitlab-ci.yml` is included in this project as reference, for live projects u - [Deployed game example](http://barichello.me/game-off/) - [Pipelines running](https://gitlab.com/BARICHELLO/game-off/pipelines) -You will need the following **Variables** set in GitLab CI/CD panel for this script to work: +You can choose either [GitLab Pages](https://gitlab.com/help/user/project/pages/index.md) or [GitHub Pages](https://pages.github.com/) to deploy this project. + +### GitLab Pages + +Delete the `deploy-github-pages` job from your `.gitlab-ci.yml`. + +### GitHub Pages + +Delete the `pages` job and set the following **Variables** in the GitLab CI/CD panel: *Access `https://gitlab.com///settings/ci_cd` to edit:* |Variable|Description|Example| |-|-|-| -| $EXPORT_NAME | Name given to the artifacts generated by godot. | `game-off` | $REMOTE_URL | The `git remote` where the web export will be hosted (in this case GitHub), it should contain your [deploy/personal access token](https://github.com/settings/tokens)|`https://:@github.com//.git` | $GIT_EMAIL | Git email of the account that will commit to the `gh-pages` branch. | `artur@barichello.me` | $GIT_USERNAME | Username of the account that will commit to the `gh-pages` branch. | `abarichello`