diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..561d9bf --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,52 @@ +stages: + - build + - deploy + +# cache using branch name +# https://gitlab.com/help/ci/caching/index.md +cache: + key: ${CI_COMMIT_REF_SLUG} + paths: + - node_modules + +build:blobs: + image: golang:1.17 + stage: build + script: + - mkdir /blobs + - make wasm + - make build-cross-clis + - mv covergen.wasm dist /blobs + artifacts: + paths: + - /blobs + expire_in: 30 days + +build:frontend: + image: node:16 + stage: build + needs: + - build:blobs + before_script: + - corepack npm install --immutable + script: + - cd frontend + - mv /blobs/* public + - corepack npm run build + artifacts: + paths: + - dist/ + expire_in: 30 days + +deploy: + stage: deploy + image: alpine + needs: + - build:frontend + before_script: + - apk add lftp + script: + - lftp "$DEPLOY_USER_PASS@vps0.miwebb.com:/" -e "mirror -R dist/ .; quit" + environment: + name: live + url: https://covergen.miwebb.dev \ No newline at end of file