-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Github Actions with aarch64 building support
- Loading branch information
Showing
4 changed files
with
54 additions
and
30 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,39 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ '*' ] | ||
pull_request: | ||
branches: [ '*' ] | ||
|
||
workflow_dispatch: | ||
schedule: | ||
- cron: '45 2 * * 0' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- image: alpine | ||
- image: centos | ||
- image: debian | ||
- image: fedora | ||
- image: ubuntu | ||
- image: archlinux | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 50 | ||
- uses: docker/setup-qemu-action@v1 | ||
- uses: docker/setup-buildx-action@v1 | ||
- run: ./ci-helpers/build.sh | ||
env: | ||
IMAGE: ${{ matrix.image }} | ||
SOURCE_IMAGE: ${{ matrix.source_image }} | ||
SKIP_REMOVE: false | ||
DOCKER_PUSH: "${{ github.ref == 'refs/heads/master' && '--push' || '' }}" | ||
DOCKER_USER: ${{ secrets.DOCKER_USER }} | ||
DOCKER_PASS: ${{ secrets.DOCKER_PASS }} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -17,8 +17,9 @@ elif [[ $image == alpine ]]; then | |
EXTRA_CMD="RUN apk --update add bash tar && rm -rf /var/cache/apk/*" | ||
fi | ||
|
||
dockerfile=$(mktemp) | ||
cat << EOF > $dockerfile | ||
workdir=$(mktemp -d) | ||
cp -r . $workdir | ||
cat << EOF > $workdir/Dockerfile | ||
FROM $source_image:$tag | ||
LABEL maintainer "Yifan Gao <[email protected]>" | ||
ENV ASSETS_DIR="/opt/smartentry/HEAD" | ||
|
@@ -27,11 +28,15 @@ COPY smartentry.sh /sbin/smartentry.sh | |
ENTRYPOINT ["/sbin/smartentry.sh"] | ||
CMD ["run"] | ||
EOF | ||
docker build -f $dockerfile -t smartentry/$image:$tag . | ||
docker tag smartentry/$image:$tag smartentry/$image:$tag$version | ||
[[ $SKIP_PUSH == true ]] || docker push smartentry/$image:$tag | ||
[[ $SKIP_PUSH == true ]] || docker push smartentry/$image:$tag$version | ||
[[ $SKIP_REMOVE == true ]] || docker rmi \ | ||
$source_image:$tag \ | ||
smartentry/$image:$tag \ | ||
smartentry/$image:$tag$version | ||
cd $workdir | ||
docker buildx build \ | ||
-t smartentry/$image:$tag \ | ||
--platform linux/amd64,linux/arm64 \ | ||
$DOCKER_PUSH . | ||
|
||
[[ -n $version ]] && docker buildx build \ | ||
-t smartentry/$image:$tag$version \ | ||
--platform linux/amd64,linux/arm64 \ | ||
$DOCKER_PUSH . | ||
|
||
[[ $SKIP_REMOVE == true ]] || docker buildx prune -a -f |
File renamed without changes.