From ab61f0eb4e9ef6bc7ca1d857b580b6d1cf86aba8 Mon Sep 17 00:00:00 2001 From: Radon Rosborough Date: Mon, 5 Jul 2021 00:41:53 +0000 Subject: [PATCH] Setting up CI --- .circleci/config.yml | 20 -------------------- .github/workflows/main.yml | 21 +++++++++++++++++++++ bin/packer | 2 ++ bin/terraform | 2 ++ tf/asg.tf | 2 +- tools/ci-bootstrap.bash | 4 ---- 6 files changed, 26 insertions(+), 25 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/main.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 831cfae..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,20 +0,0 @@ -version: 2 -workflows: - version: 2 - ci: - jobs: - - build_and_deploy: - filters: - branches: - only: master - tags: - ignore: /.*/ -jobs: - build_and_deploy: - machine: - image: ubuntu-2004:202010-01 - steps: - - checkout - - run: - command: tools/ci-bootstrap.bash - no_output_timeout: 2h diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..ce0dcac --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,21 @@ +name: Build and deploy +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build and deploy + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + DOCKER_REPO: 084011155226.dkr.ecr.us-west-1.amazonaws.com/riju + S3_BUCKET: riju + run: | + make image shell I=ci CMD="tools/ci-bootstrap.bash" diff --git a/bin/packer b/bin/packer index 046bb48..8371d78 100755 --- a/bin/packer +++ b/bin/packer @@ -10,4 +10,6 @@ set -a . "${root}/.env" set +a +cd "${root}/packer" + exec packer "$@" diff --git a/bin/terraform b/bin/terraform index 58dbe2c..b4cf3b2 100755 --- a/bin/terraform +++ b/bin/terraform @@ -10,4 +10,6 @@ set -a . "${root}/.env" set +a +cd "${root}/tf" + exec terraform "$@" diff --git a/tf/asg.tf b/tf/asg.tf index 925ee94..ca48c4a 100644 --- a/tf/asg.tf +++ b/tf/asg.tf @@ -63,7 +63,7 @@ resource "aws_launch_template" "server" { device_name = "/dev/sdh" ebs { volume_type = "gp3" - volume_size = 125 + volume_size = 256 } } diff --git a/tools/ci-bootstrap.bash b/tools/ci-bootstrap.bash index 5128d41..1cfec51 100755 --- a/tools/ci-bootstrap.bash +++ b/tools/ci-bootstrap.bash @@ -4,11 +4,7 @@ set -euo pipefail : ${AWS_ACCESS_KEY_ID} : ${AWS_SECRET_ACCESS_KEY} -: ${DEPLOY_SSH_PRIVATE_KEY} -: ${DOCKER_PASSWORD} : ${DOCKER_REPO} -: ${DOCKER_USERNAME} -: ${DOMAIN} : ${S3_BUCKET} make image shell I=ci CMD="tools/ci-run.bash"