From 138c8db2c37c272f5890fb362a33783264424b78 Mon Sep 17 00:00:00 2001 From: Liora Milbaum Date: Mon, 13 Feb 2023 16:33:25 +0200 Subject: [PATCH] feat(ci): Spin crc-cloud in CI --- .github/workflows/crc-cloud.yml | 54 +++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/crc-cloud.yml diff --git a/.github/workflows/crc-cloud.yml b/.github/workflows/crc-cloud.yml new file mode 100644 index 0000000..7f1ffff --- /dev/null +++ b/.github/workflows/crc-cloud.yml @@ -0,0 +1,54 @@ +name: crc-cloud + +on: + pull_request: + branches: + - main + + workflow_dispatch: + +jobs: + crc-cloud: + runs-on: ubuntu-latest + + permissions: + id-token: write + contents: write + + steps: + - name: Write pullsecret + env: + PULLSECRET_BASE64: ${{ secrets.PS_64 }} + run: | + echo $PULLSECRET_BASE64 | base64 --decode > pullsecret.txt + + - name: Write boot key + run: echo "${{ secrets.KEY }}" > key.txt + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: ${{ secrets.ROLE }} + aws-region: eu-west-2 + + - run: | + docker run \ + -v ${PWD}:/workspace:z \ + -e AWS_DEFAULT_REGION=eu-west-2 quay.io/crcont/crc-cloud:v0.0.2 \ + create aws \ + --project-name "crc-ocp412" \ + --backed-url "file:///workspace" \ + --output "/workspace" \ + --aws-ami-id "ami-019669c0960dbcf14" \ + --pullsecret-filepath /workspace/pullsecret.txt \ + --key-filepath /workspace/key.txt + + - run: | + docker run \ + -v ${PWD}:/workspace:z \ + -e AWS_DEFAULT_REGION=eu-west-2 \ + quay.io/crcont/crc-cloud:v0.0.2 \ + destroy \ + --project-name "crc-ocp412" \ + --backed-url "file:///workspace" \ + --provider "aws"