-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add build files for ARM * Run arm build only on success of main build
- Loading branch information
1 parent
2f12e7a
commit dc7cd3f
Showing
2 changed files
with
79 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,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 }} |
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,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" ] |