Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gitaction #12

Open
wants to merge 46 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
759674b
minimum gitaction
JLKwong Apr 26, 2021
5b16989
Update main.yml
JLKwong Apr 26, 2021
f63d31e
Update main.yml
JLKwong Apr 26, 2021
d36b928
Update main.yml
JLKwong Apr 26, 2021
a1e944c
Update main.yml
JLKwong Apr 26, 2021
165cc89
Rename utils.sh to .github/workflows/utils.sh
JLKwong Apr 26, 2021
1f202ef
Update main.yml
JLKwong Apr 26, 2021
ebee279
Update main.yml
JLKwong Apr 26, 2021
041885d
Update main.yml
JLKwong Apr 26, 2021
3fd9520
Update main.yml
JLKwong Apr 26, 2021
820d77a
Update main.yml
JLKwong Apr 26, 2021
c7c248d
Update main.yml
JLKwong Apr 26, 2021
717e6a0
Update main.yml
JLKwong Apr 26, 2021
239b629
Update main.yml
JLKwong Apr 26, 2021
855047a
Update main.yml
JLKwong Apr 26, 2021
d401069
Update main.yml
JLKwong Apr 26, 2021
7586e43
Update main.yml
JLKwong Apr 26, 2021
edba375
Update main.yml
JLKwong Apr 26, 2021
7bccd55
Update main.yml
JLKwong Apr 26, 2021
6847f64
Update main.yml
JLKwong Apr 26, 2021
c7162c0
Update main.yml
JLKwong Apr 26, 2021
d4d8c11
Update main.yml
JLKwong Apr 26, 2021
fdc495c
Update main.yml
JLKwong Apr 26, 2021
c60da47
Update main.yml
JLKwong Apr 26, 2021
4bec6a2
Update main.yml
JLKwong Apr 26, 2021
6a1c975
Update main.yml
JLKwong Apr 26, 2021
08cce14
Update main.yml
JLKwong Apr 26, 2021
d72ddcc
Update main.yml
JLKwong Apr 26, 2021
81b5847
Update main.yml
JLKwong Apr 26, 2021
a787bea
Update main.yml
JLKwong Apr 26, 2021
0e09952
Update main.yml
JLKwong Apr 26, 2021
0c8551f
Update main.yml
JLKwong Apr 26, 2021
2df7e25
Update main.yml
JLKwong Apr 26, 2021
a737177
Update main.yml
JLKwong Apr 26, 2021
2cfaac7
Update main.yml
JLKwong Apr 26, 2021
9d91aaf
Update main.yml
JLKwong Apr 26, 2021
7818bac
Update main.yml
JLKwong Apr 26, 2021
92cab9a
Update main.yml
JLKwong Apr 26, 2021
84f473e
Update main.yml
JLKwong Apr 26, 2021
9696b72
Update main.yml
JLKwong Apr 26, 2021
6491315
Update main.yml
JLKwong Apr 26, 2021
cb0894a
Update main.yml
JLKwong Apr 26, 2021
24b17f1
Update main.yml
JLKwong Apr 26, 2021
80a2cbb
Update main.yml
JLKwong Apr 26, 2021
08b8840
Update main.yml
JLKwong Apr 26, 2021
169b695
Update main.yml
JLKwong Apr 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: musicblocks-test

on:
push:
schedule:
- cron: '0 */8 * * *'

jobs:
musicblocks-docker-image-build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: docker login
run: docker login -u ${{ secrets.DOCKERUSERNAME }} -p ${{ secrets.DOCKERAPIKEY }}
- name: treehouses musicblocks
run: |
export DOCKER_CLI_EXPERIMENTAL=enabled
repo="jleekwong/musicblocks"
source .github/workflows/utils.sh
music_arm_sha=$(get_manifest_sha "$repo:latest" "arm")
echo $music_arm_sha
nginx_arm_sha=$(get_manifest_sha "treehouses/nginx:latest" "arm")
echo $nginx_arm_sha
flag_arm=$(is_base "treehouses/nginx@"$nginx_arm_sha "$repo@"$music_arm_sha)
echo $flag_arm
music_amd64_sha=$(get_manifest_sha "$repo:latest" "amd64")
echo $music_amd64_sha
nginx_amd64_sha=$(get_manifest_sha "treehouses/nginx:latest" "amd64")
echo $nginx_amd64_sha
flag_amd64=$(is_base "treehouses/nginx@"$nginx_amd64_sha "$repo@"$music_amd64_sha)
echo $flag_amd64
music_arm64_sha=$(get_manifest_sha "$repo:latest" "arm64")
echo $music_arm64_sha
nginx_arm64_sha=$(get_manifest_sha "treehouses/nginx:latest" "arm64")
echo $nginx_arm64_sha
flag_arm64=$(is_base "treehouses/nginx@"$nginx_arm64_sha "$repo@"$music_arm64_sha)
echo $flag_arm64
flag=$(compare "treehouses/nginx@"$nginx_arm_sha "$repo@"$music_arm_sha "treehouses/nginx@"$nginx_amd64_sha "$repo@"$music_amd64_sha "treehouses/nginx@"$nginx_arm64_sha "$repo@"$music_arm64_sha)
echo $flag
if [[ $flag == true ]]; then
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
build_image "treehouses/nginx:latest" arm "$repo" #base image is arm arch
build_image "treehouses/nginx:latest" amd64 "$repo" #base image is amd64 arch
build_image "treehouses/nginx:latest" arm64 "$repo" #base image is arm64 arch
deploy_image "$repo" arm
deploy_image "$repo" amd64
deploy_image "$repo" arm64
tag=$(date +%Y%m%d%H%M)
tag2="latest"
echo $tag
create_manifest $repo $tag $tag2 $repo-tags:amd64 $repo-tags:arm $repo-tags:arm64
docker manifest inspect $repo:$tag
docker manifest inspect $repo:$tag2
docker manifest push $repo:$tag; docker manifest push $repo:$tag2
else
echo "no changes"
fi
File renamed without changes.