Skip to content

Commit

Permalink
[WIP] test job to debug the compiler service container github action
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisandreae committed Jun 21, 2024
1 parent 0b82d09 commit e46f883
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/test-build-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Test build job to debug skopeo issues with OCI containers
name: Test Build For Compiler Service Container

on:
push:
branches:
- "**"

jobs:
build:
# This job must never be run on a PR from outside the same repository
runs-on: ubuntu-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
env:
ECR_REPOSITORY: zmk-builder-lambda
REVISION_TAG: ${{ github.event.pull_request && github.event.pull_request.head.sha || github.sha }}
PR_NUMBER: ${{ github.event.number }}
steps:
- uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::431227615537:role/GithubCompilerLambdaBuilder
aws-region: us-east-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-22.05
- uses: cachix/cachix-action@v15
with:
name: moergo-glove80-zmk-dev
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Build lambda image
run: nix-build release.nix --arg revision "\"${REVISION_TAG}\"" -A lambdaImage -o lambdaImage
- name: Import OCI image into docker-daemon
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
run: nix shell -f nix/pinned-nixpkgs.nix skopeo -c skopeo --insecure-policy copy oci:lambdaImage docker-daemon:$REGISTRY/$ECR_REPOSITORY:$REVISION_TAG

0 comments on commit e46f883

Please sign in to comment.