image: "gitea.nulo.in/sutty/panel:3.14.10-2.7.8-panel.sutty.nl" variables: RAILS_ENV: "production" LC_ALL: "C.UTF-8" cache: paths: - "vendor/ruby" assets: stage: "build" rules: - if: "$CI_COMMIT_BRANCH == \"panel.sutty.nl\"" - if: "$CI_COMMIT_BRANCH" changes: compare_to: "refs/heads/rails" paths: - "package.json" - "app/javascript/**/*" - "app/assets/**/*" - ".gitlab-ci.yml" before_script: - "test -n \"${GITLAB_CI_PUSH_TOKEN}\"" - "git config --global user.email \"${GIT_USER_EMAIL:-$GITLAB_USER_EMAIL}\"" - "git config --global user.name \"${GIT_USER_NAME:-$GITLAB_USER_NAME}\"" - "git remote set-url --push origin \"https://GITLAB_CI_PUSH_TOKEN:${GITLAB_CI_PUSH_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git\"" - "apk add python2 dotenv brotli" - "mv config/credentials.yml.enc.ci config/credentials.yml.enc" - "cp .env.example .env" - "dotenv bundle install --path=vendor" - "yarn install" script: - "dotenv RAILS_ENV=production bundle exec rails webpacker:clobber" - "dotenv RAILS_ENV=production bundle exec rails assets:precompile" - "dotenv RAILS_ENV=production bundle exec rails assets:clean" - "git add public && git commit -m \"ci: assets [skip ci]\"" - "git push -o ci.skip origin HEAD:panel.sutty.nl"