From eb27abbaae132592c774385a07981472b9931522 Mon Sep 17 00:00:00 2001 From: video-prize-ranch Date: Sat, 14 May 2022 11:47:28 -0400 Subject: [PATCH] Add deploy stage --- .gitlab-ci.yml | 20 +++++++++++++++++--- fly.toml | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 fly.toml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 018e328..d79fd29 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,9 +2,13 @@ variables: REPO_NAME: codeberg.org/video-prize-ranch/rimgo DOCKER_HOST: tcp://docker:2375 -build: +stages: + - build + - deploy + +docker: image: docker:20 - stage: deploy + stage: build services: - name: docker:20-dind command: ["--experimental"] @@ -18,4 +22,14 @@ build: - docker context create mybuilder - docker buildx create --use --name mybuilder mybuilder - docker pull $CI_REGISTRY_IMAGE:latest || true - - docker buildx build --cache-from $CI_REGISTRY_IMAGE:latest --platform linux/amd64,linux/arm64 --push -t $CI_REGISTRY_IMAGE:latest . \ No newline at end of file + - docker buildx build --cache-from $CI_REGISTRY_IMAGE:latest --platform linux/amd64,linux/arm64 --push -t $CI_REGISTRY_IMAGE:latest . + +deploy: + image: alpine:latest + stage: deploy + needs: [] + before_script: + - apk update && apk --no-cache add curl + - wget -O - https://fly.io/install.sh | sh + script: + - /root/.fly/bin/flyctl deploy --no-cache --detach \ No newline at end of file diff --git a/fly.toml b/fly.toml new file mode 100644 index 0000000..b1f0883 --- /dev/null +++ b/fly.toml @@ -0,0 +1,40 @@ +# fly.toml file generated for autumn-star-1901 on 2022-05-02T21:08:36-04:00 + +app = "autumn-star-1901" + +kill_signal = "SIGINT" +kill_timeout = 5 +processes = [] + +[env] + +[experimental] + allowed_public_ports = [] + auto_rollback = true + +[[services]] + http_checks = [] + internal_port = 3000 + processes = ["app"] + protocol = "tcp" + script_checks = [] + + [services.concurrency] + hard_limit = 25 + soft_limit = 20 + type = "connections" + + [[services.ports]] + force_https = true + handlers = ["http"] + port = 80 + + [[services.ports]] + handlers = ["tls", "http"] + port = 443 + + [[services.tcp_checks]] + grace_period = "1s" + interval = "15s" + restart_limit = 0 + timeout = "2s"