From 8a84d0ae8b6129be97bfc20cb10bc9dc02a33229 Mon Sep 17 00:00:00 2001 From: MahdiBM Date: Sun, 15 Dec 2024 17:40:52 +0330 Subject: [PATCH] fix penny deployment CI + disable caching for lambdas deployments --- .github/scripts/install-docker.bash | 23 +++++++++++++++++++++++ .github/workflows/deploy-all-lambdas.yml | 2 ++ .github/workflows/deploy-penny.yml | 10 ++++++++++ 3 files changed, 35 insertions(+) create mode 100755 .github/scripts/install-docker.bash diff --git a/.github/scripts/install-docker.bash b/.github/scripts/install-docker.bash new file mode 100755 index 00000000..6a8b34bd --- /dev/null +++ b/.github/scripts/install-docker.bash @@ -0,0 +1,23 @@ +#!/bin/bash + +set -eu + +# Docker installation steps, from their own website: + +# Add Docker's official GPG key: +apt-get update -y +apt-get install ca-certificates curl gnupg -y +install -m 0755 -d /etc/apt/keyrings +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg +chmod a+r /etc/apt/keyrings/docker.gpg + +# Add the repository to Apt sources: +# shellcheck source=/dev/null +echo \ + "deb [arch=\"$(dpkg --print-architecture)\" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ + \"$(. /etc/os-release && echo "$VERSION_CODENAME")\" stable" | + tee /etc/apt/sources.list.d/docker.list >/dev/null +apt-get update -y + +# Install Docker: +apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y diff --git a/.github/workflows/deploy-all-lambdas.yml b/.github/workflows/deploy-all-lambdas.yml index 71ed26e4..e09a3974 100644 --- a/.github/workflows/deploy-all-lambdas.yml +++ b/.github/workflows/deploy-all-lambdas.yml @@ -33,6 +33,7 @@ jobs: git checkout ${{ github.sha }} - name: Restore .build + if: false # ❌ Needs node 20 which amazonlinux2 doesn't have id: "restore-cache" uses: actions/cache/restore@v4 with: @@ -71,6 +72,7 @@ jobs: done - name: Cache .build + if: false # ❌ Needs node 20 which amazonlinux2 doesn't have uses: actions/cache/save@v4 with: path: ${{ github.event.repository.name }}/.build diff --git a/.github/workflows/deploy-penny.yml b/.github/workflows/deploy-penny.yml index ba92c4b1..24d5eb2a 100644 --- a/.github/workflows/deploy-penny.yml +++ b/.github/workflows/deploy-penny.yml @@ -11,6 +11,8 @@ jobs: runs-on: ubuntu-latest + container: swift:6.0-jammy + steps: - name: Checkout uses: actions/checkout@v4 @@ -42,6 +44,14 @@ jobs: path: .build key: "penny-release-static-build-${{ runner.os }}-${{ github.event.after }}" + - name: Install Docker + run: | + # Make scripts executable + chmod +x ./.github/scripts/* + + # Install Docker + ./.github/scripts/install-docker.bash + - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 with: