Skip to content

Commit

Permalink
Updating cd workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kvg committed Oct 15, 2024
1 parent 9c46a09 commit f4149f3
Showing 1 changed file with 53 additions and 30 deletions.
83 changes: 53 additions & 30 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,29 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
tags: true

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Run sccache-cache
uses: mozilla-actions/[email protected]

- name: Build Rust binary
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
run: |
cargo build --release
strip target/release/hidive
sccache --show-stats
- name: Upload binary as artifact
uses: actions/upload-artifact@v3
with:
name: hidive-${{ steps.version-bump.outputs.new_ver }}
path: target/release/hidive

- name: Create Github release
id: create_release
uses: actions/create-release@v1
Expand All @@ -40,37 +63,37 @@ jobs:
draft: false
prerelease: false

- name: Authenticate to Google Cloud
id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
# - name: Authenticate to Google Cloud
# id: 'auth'
# uses: 'google-github-actions/auth@v1'
# with:
# credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
# - name: Cache Docker layers
# uses: actions/cache@v3
# with:
# path: /tmp/.buildx-cache
# key: ${{ runner.os }}-buildx-${{ github.sha }}
# restore-keys: |
# ${{ runner.os }}-buildx-

- name: Configure Docker to use gcloud credentials
run: gcloud auth configure-docker us.gcr.io -q
# - name: Configure Docker to use gcloud credentials
# run: gcloud auth configure-docker us.gcr.io -q

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: ./docker
push: true
tags: us.gcr.io/broad-dsp-lrma/lr-hidive:${{ steps.version-bump.outputs.new_ver }}
build-args: |
branch=v${{ steps.version-bump.outputs.new_ver }}
cache-from: |
type=local,src=/tmp/.buildx-cache
type=gha,scope=${{ github.workflow }}
cache-to: |
type=local,dest=/tmp/.buildx-cache-new,mode=max
type=gha,mode=max,scope=${{ github.workflow }}
# - name: Build and push Docker image
# uses: docker/build-push-action@v4
# with:
# context: ./docker
# push: true
# tags: us.gcr.io/broad-dsp-lrma/lr-hidive:${{ steps.version-bump.outputs.new_ver }}
# build-args: |
# branch=v${{ steps.version-bump.outputs.new_ver }}
# cache-from: |
# type=local,src=/tmp/.buildx-cache
# type=gha,scope=${{ github.workflow }}
# cache-to: |
# type=local,dest=/tmp/.buildx-cache-new,mode=max
# type=gha,mode=max,scope=${{ github.workflow }}

0 comments on commit f4149f3

Please sign in to comment.