Skip to content

Commit

Permalink
Update GH CI actions
Browse files Browse the repository at this point in the history
  • Loading branch information
thenav56 authored and AdityaKhatri committed Nov 28, 2023
1 parent 71476be commit 9b6b839
Showing 1 changed file with 8 additions and 25 deletions.
33 changes: 8 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: 🚴 Build + Test 🚴 # Match the name below (8398a7/action-slack).
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@master

- name: 🐳 Prepare Docker
id: prep
Expand All @@ -24,17 +24,8 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@master

- name: 🐳 Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.ref }}
restore-keys: |
${{ runner.os }}-buildx-refs/develop
${{ runner.os }}-buildx-
- name: 🐳 Build image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
Expand All @@ -43,8 +34,9 @@ jobs:
load: true
target: worker # this has all the dep
tags: ${{ steps.prep.outputs.tagged_image }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
# Using experimental GH api: https://docs.docker.com/build/ci/github-actions/cache/#cache-backend-api
cache-from: type=gha
cache-to: type=gha,mode=max

- name: 🕮 Validate latest graphql schema.
env:
Expand All @@ -67,7 +59,7 @@ jobs:
}
- name: 🤞 Run Test 🧪 & Publish coverage to code climate
uses: paambaati/codeclimate-action@v2.7.5
uses: paambaati/codeclimate-action@v5.0.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CODE_CLIMATE_ID }}
DOCKER_IMAGE_SERVER: ${{ steps.prep.outputs.tagged_image }}
Expand All @@ -77,19 +69,10 @@ jobs:
${{github.workspace}}/coverage/coverage.xml:coverage.py
- name: Publish coverage to code cov
uses: codecov/codecov-action@v2

# Temp fix
# https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#github-cache
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: 🐳 Move docker cache (🧙 Hack fix)
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
uses: codecov/codecov-action@v3

- name: Deploy coverage to GH Pages 🚀
uses: JamesIves/github-pages-deploy-action@4.1.4
uses: JamesIves/github-pages-deploy-action@v4
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
with:
branch: gh-pages
Expand Down

0 comments on commit 9b6b839

Please sign in to comment.