From a4810b98d3fbec547b137a2cbebd0fa327ea5ea3 Mon Sep 17 00:00:00 2001 From: yuenmichelle1 Date: Mon, 4 Dec 2023 13:53:00 -0600 Subject: [PATCH] update deploy app build and push step --- .github/workflows/deploy_app.yml | 39 ++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy_app.yml b/.github/workflows/deploy_app.yml index 9ddb6f6a8..ebb6195e7 100644 --- a/.github/workflows/deploy_app.yml +++ b/.github/workflows/deploy_app.yml @@ -8,13 +8,38 @@ on: jobs: build_and_push_image: - name: Build and Push Image - uses: zooniverse/ci-cd/.github/workflows/build_and_push_image.yaml@main - with: - repo_name: camera-traps-api - commit_id: ${{ github.sha }} - file: ./api/batch_processing/api_core/Dockerfile - latest: true + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + with: + repository: zooniverse/camera-traps-api + ref: zooniverse-deployment + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3.0.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3.0.0 + + - name: Create commit_id.txt + run: echo ${{ github.sha }} > commit_id.txt + + - name: Build and push + uses: docker/build-push-action@v5.1.0 + with: + context: . + file: ./api/batch_processing/api_core/Dockerfile + push: true + tags: | + ghcr.io/zooniverse/camera-traps-api:latest + ghcr.io/zooniverse/camera-traps-api:${{ github.sha }} + cache-from: type=gha + cache-to: type=gha,mode=max deploy_app: runs-on: ubuntu-latest