From 64957ddd70e386eb331fe575659f9fa16c14bde4 Mon Sep 17 00:00:00 2001 From: "spaceBearAmadeus (Alex)" Date: Wed, 30 Oct 2024 16:31:09 -0400 Subject: [PATCH] update env change --- .../{continuous-integration.yml => ci.yml} | 25 +++++------- .github/workflows/deploy.yml | 40 +++++++++++++++++++ .../{delivery.yml => experimental/delivery} | 0 .github/workflows/{ => experimental}/deploy | 0 .../deployment} | 0 .../integration} | 0 6 files changed, 49 insertions(+), 16 deletions(-) rename .github/workflows/{continuous-integration.yml => ci.yml} (65%) create mode 100644 .github/workflows/deploy.yml rename .github/workflows/{delivery.yml => experimental/delivery} (100%) rename .github/workflows/{ => experimental}/deploy (100%) rename .github/workflows/{deployment.yml => experimental/deployment} (100%) rename .github/workflows/{integration.yaml => experimental/integration} (100%) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/ci.yml similarity index 65% rename from .github/workflows/continuous-integration.yml rename to .github/workflows/ci.yml index 5f1040a2b..5fb08b996 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/ci.yml @@ -4,17 +4,13 @@ on: push: jobs: - configure-environment: + build-base-image: + environment: bio-check-prod runs-on: ubuntu-latest steps: - # Step 1: Checkout repository - name: Checkout code uses: actions/checkout@v2 - # Step 2: Log in to GHCR - - name: Test Log in to GHCR - run: echo "${{ secrets.REPO_ADMIN_GHCR_TOKEN }}" | docker login ghcr.io -u "${{ secrets.REPO_ADMIN_GH_USERNAME }}" --password-stdin - # Step 3: Install Docker Compose - name: Install Docker Compose run: | @@ -22,13 +18,6 @@ jobs: sudo chmod +x /usr/local/bin/docker-compose docker-compose --version # Check if Docker Compose is installed correctly - build-base-image: - needs: configure-environment - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Get base image version run: | BASE_VERSION=$(cat ./assets/.BASE_VERSION) @@ -41,7 +30,11 @@ jobs: env: BIOSIMULATIONS_GCLOUD_CONFIG: ${{ secrets.BIO_JSON_CONTENT }} - - name: Build base image + - name: Get new base tag + run: | + BASE_IMG=ghcr.io/biosimulators/bio-check-base + echo "BASE_IMG=$BASE_IMG" >> $GITHUB_ENV + + - name: Test build base image run: | - docker build --no-cache -f ./Dockerfile-base -t ghcr.io/biosimulators/bio-check-base:${{ env.BASE_VERSION }} . - docker images + docker build --no-cache -f ./Dockerfile-base -t ${{ env.BASE_IMG }}:${{ env.BASE_VERSION }} . diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 000000000..9e64d8233 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,40 @@ +name: Deploy Service Images + +on: + workflow_dispatch: + +jobs: + deploy-base-image: + environment: bio-check-prod + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Log in to GHCR + run: echo "${{ secrets.REPO_ADMIN_GHCR_TOKEN }}" | docker login ghcr.io -u "${{ secrets.REPO_ADMIN_GH_USERNAME }}" --password-stdin + + - name: Get base image version + run: | + BASE_VERSION=$(cat ./assets/.BASE_VERSION) + echo "BASE_VERSION=$BASE_VERSION" >> $GITHUB_ENV + echo "Base Version: $BASE_VERSION" + + - name: Create gcloud config + run: | + echo "$BIOSIMULATIONS_GCLOUD_CONFIG" > ./assets/configs/.biosimulations.json + env: + BIOSIMULATIONS_GCLOUD_CONFIG: ${{ secrets.BIO_JSON_CONTENT }} + + - name: Build base image + run: | + docker build --no-cache -f ./Dockerfile-base -t ${{ env.BASE_IMG }}:${{ env.BASE_VERSION }} . + + - name: Deploy new base version to GHCR + run: | + docker push ${{ env.BASE_IMG }}:${{ env.BASE_VERSION }} + + - name: Deploy new latest base version + run: | + docker tag ${{ env.BASE_IMG }}:${{ env.BASE_VERSION }} ${{ env.BASE_IMG }}:latest + docker push ${{ env.BASE_IMG }}:latest \ No newline at end of file diff --git a/.github/workflows/delivery.yml b/.github/workflows/experimental/delivery similarity index 100% rename from .github/workflows/delivery.yml rename to .github/workflows/experimental/delivery diff --git a/.github/workflows/deploy b/.github/workflows/experimental/deploy similarity index 100% rename from .github/workflows/deploy rename to .github/workflows/experimental/deploy diff --git a/.github/workflows/deployment.yml b/.github/workflows/experimental/deployment similarity index 100% rename from .github/workflows/deployment.yml rename to .github/workflows/experimental/deployment diff --git a/.github/workflows/integration.yaml b/.github/workflows/experimental/integration similarity index 100% rename from .github/workflows/integration.yaml rename to .github/workflows/experimental/integration