Skip to content

fix: arm64 package. #38

fix: arm64 package.

fix: arm64 package. #38

Workflow file for this run

name: Dev Deploy
on:
push:
branches:
- dev
- nav/test-runners
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
deploy_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
# Set up Rust
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.80.1
target: aarch64-unknown-linux-gnu
# Cache Rust dependencies
- name: Cache Cargo registry and index
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
# Cache build folder (target)
- name: Cache target directory
uses: actions/cache@v3
with:
path: target
key: ${{ runner.os }}-target-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-target-
# Build the project
- name: Install cross-compilation tools
run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu libssl-dev:arm64
- name: Cargo Build - aarch64-unknown-linux-gnu
shell: bash
run: |
rustup target add aarch64-unknown-linux-gnu
cargo build --release --locked --target aarch64-unknown-linux-gnu
ls -la ./target
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up QEMU
uses: docker/[email protected]
with:
platforms: arm64
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::417712557820:role/GithubDeployRole
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ steps.login-ecr.outputs.registry }}/source-data-proxy
tags: |
type=sha
- name: Build and push
id: docker_push
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # ratchet:docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/arm64/v8
secrets: |
"github_token=${{ secrets.GITHUB_TOKEN }}"
- name: Render Amazon ECS task definition
id: render-data-proxy-container
uses: aws-actions/amazon-ecs-render-task-definition@v1
with:
task-definition-family: source-data-proxy
container-name: source-data-proxy
image: ${{ steps.meta.outputs.tags }}
- name: Deploy to Amazon ECS service
uses: aws-actions/amazon-ecs-deploy-task-definition@v2
with:
task-definition: ${{ steps.render-data-proxy-container.outputs.task-definition }}
service: source-data-proxy
cluster: SourceCooperative-Dev