From 0cd658cf441842f375aa7263e3f934a97430724d Mon Sep 17 00:00:00 2001 From: Tobias Waslowski Date: Sat, 20 Jan 2024 12:14:49 +0100 Subject: [PATCH] Add more CI steps --- .github/workflows/build.yml | 42 ++++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e105a49..8d8a399 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,5 @@ name: Docker Image CI - + permissions: contents: read id-token: write @@ -11,7 +11,26 @@ on: branches: [ "main" ] jobs: - build: + build-docker: + runs-on: ubuntu-latest + steps: + - name: Install dependencies + uses: actions/checkout@v3 + run: | + sudo apt update + sudo apt install pipx + pipx ensurepath + pipx install poetry + + - name: Poetry setup + run: | + cd backend && poetry install + + - name: Build the Docker image + uses: actions/checkout@v3 + run: cd backend && ./docker-util.sh build translation + + push-docker: runs-on: ubuntu-latest steps: - name: Configure AWS Credentials @@ -19,10 +38,17 @@ jobs: with: role-to-assume: arn:aws:iam::246770851643:role/github-actions aws-region: eu-central-1 - - uses: actions/checkout@v3 - name: Build the Docker image - run: | - pushd backend - ./docker-util.sh build translation - ./docker-util.sh push translation - cd terraform && terraform apply -auto-approve + uses: actions/checkout@v3 + run: cd backend && ./docker-util.sh build translation + + create-infrastructure: + runs-on: ubuntu-latest + steps: + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::246770851643:role/github-actions + aws-region: eu-central-1 + - name: Create Terraform Infrastructure + run: cd terraform && terraform apply -auto-approve