Skip to content

Commit

Permalink
feat(docker): publish arm64 images
Browse files Browse the repository at this point in the history
  • Loading branch information
jagregory committed Feb 16, 2022
1 parent 70bb6f1 commit df0033b
Show file tree
Hide file tree
Showing 4 changed files with 305 additions and 2,496 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
},
"devDependencies": {
"@babel/preset-typescript": "^7.16.0",
"@codedependant/semantic-release-docker": "^3.1.2",
"@commitlint/cli": "^15.0.0",
"@commitlint/config-conventional": "^15.0.0",
"@jest/globals": "^27.0.6",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@types/aws-lambda": "^8.10.85",
"@types/body-parser": "^1.19.0",
Expand Down Expand Up @@ -109,9 +109,8 @@
["@semantic-release/github", {
"addReleases": "top"
}],
["@codedependant/semantic-release-docker", {
"dockerLogin": false,
"dockerImage": "jagregory/cognito-local"
["@semantic-release/exec", {
"publishCmd": "./scripts/dockerBuildPush.sh ${nextRelease.version}"
}],
["@semantic-release/git", {
"assets": ["CHANGELOG.md"]
Expand Down
21 changes: 21 additions & 0 deletions scripts/dockerBuildPush.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash -e

version=$1

if [ -z "$version" ]; then
echo 'Missing version' >&2
exit 1
fi

versionArr=(${version//./ })
major_version=${versionArr[0]}

docker buildx build \
--platform linux/amd64,linux/arm64 \
--tag jagregory/cognito-local:latest \
--tag jagregory/cognito-local:${major_version}-latest \
--tag jagregory/cognito-local:${version} \
--push \
.

echo "{\"name\":\"Docker\",\"url\":\"https://hub.docker.com/r/jagregory/cognito-local\"}"
Loading

0 comments on commit df0033b

Please sign in to comment.