forked from zmkfirmware/zmk
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] test job to debug the compiler service container github action
- Loading branch information
1 parent
0b82d09
commit 7a62656
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# 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: | ||
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: Extract container name from branch name | ||
shell: bash | ||
run: | | ||
if [ "$GITHUB_HEAD_REF" ]; then | ||
branch_ref="$GITHUB_HEAD_REF" | ||
type="pr" | ||
tag="pr${PR_NUMBER}.${GITHUB_HEAD_REF}" | ||
elif [[ "$GITHUB_REF" == refs/tags/* ]]; then | ||
branch_ref="$GITHUB_REF" | ||
type="tag" | ||
tag="${GITHUB_REF#refs/tags/}" | ||
else | ||
echo "Not a pull request or release tag" >&2 | ||
exit 1 | ||
fi | ||
# Replace / with . in container tag names | ||
tag="${tag//\//.}" | ||
echo "VERSION_BRANCH=${branch_ref}" >> $GITHUB_ENV | ||
echo "VERSION_TYPE=${type}" >> $GITHUB_ENV | ||
echo "VERSION_NAME=${tag}" >> $GITHUB_ENV | ||
id: extract_name | ||
- 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: skopeo --insecure-policy copy oci:lambdaImage docker-daemon:$REGISTRY/$ECR_REPOSITORY:$REVISION_TAG |