Skip to content

Commit

Permalink
Add build files for ARM (#802)
Browse files Browse the repository at this point in the history
* Add build files for ARM

* Run arm build only on success of main build
  • Loading branch information
scottyeager authored Oct 19, 2023
1 parent 2f12e7a commit dc7cd3f
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/publish_arm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Publish ARM

on:
workflow_run:
workflows: ["Full Clients Publish"]
types:
- completed

jobs:
docker-image-grid-http-server:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: 'Get tag'
id: tag
uses: actions/github-script@v6
with:
result-encoding: string
script: |
let run = await github.rest.actions.getWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
return run.data.head_branch;
- name: Checkout the repo
uses: actions/checkout@v3
with:
ref: ${{ steps.tag.outputs.result }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

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

- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v4
with:
context: git
images: ghcr.io/${{ github.repository_owner }}/grid_http_server
flavor: |
suffix=-arm,onlatest=true
tags: |
type=semver,pattern={{version}}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: packages/grid_http_server/arm
push: true
platforms: linux/arm64,linux/armhf
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
GRID_VERSION=${{ steps.tag.outputs.result }}
11 changes: 11 additions & 0 deletions packages/grid_http_server/arm/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM alpine AS build

ARG GRID_VERSION
RUN apk add nodejs npm curl python3 build-base && npm install --global yarn && yarn add @threefold/grid_http_server@${GRID_VERSION}

FROM alpine
RUN apk add nodejs npm curl && npm install --global yarn
COPY --from=build /node_modules /node_modules
COPY --from=build /package.json /yarn.lock /

ENTRYPOINT [ "yarn" ]

0 comments on commit dc7cd3f

Please sign in to comment.