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

Docker build #6

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0046615
Create main.yml
JLKwong Apr 29, 2021
12cb3ad
Rename utils.sh to .github/workflows/utils.sh
JLKwong Apr 29, 2021
b30c705
Update main.yml
JLKwong Apr 29, 2021
f2a05cb
Update main.yml
JLKwong Apr 29, 2021
bb8fc60
Update main.yml
JLKwong Apr 29, 2021
85e92d0
Update main.yml
JLKwong Apr 29, 2021
a199a6f
Update main.yml
JLKwong Apr 29, 2021
4c4135e
Update main.yml
JLKwong Apr 29, 2021
7ad80c2
Update main.yml
JLKwong Apr 29, 2021
7d29572
Update main.yml
JLKwong Apr 29, 2021
ae15b9d
Update main.yml
JLKwong Apr 29, 2021
9306c99
Update main.yml
JLKwong Apr 30, 2021
f1b0536
Update main.yml
JLKwong Apr 30, 2021
4524e0d
Update main.yml
JLKwong Apr 30, 2021
485103b
Update main.yml
JLKwong Apr 30, 2021
238983c
Update main.yml
JLKwong Apr 30, 2021
ed755b2
Update main.yml
JLKwong Apr 30, 2021
3b4d64a
Update main.yml
JLKwong Apr 30, 2021
32f9641
Update main.yml
JLKwong Apr 30, 2021
568abd9
Update main.yml
JLKwong Apr 30, 2021
406ea9b
Update main.yml
JLKwong Apr 30, 2021
a912a8d
Update main.yml
JLKwong Apr 30, 2021
1cfb8b0
Update main.yml
JLKwong Apr 30, 2021
7d74483
Update main.yml
JLKwong Apr 30, 2021
27b130b
Update main.yml
JLKwong Apr 30, 2021
369b99a
Update main.yml
JLKwong Apr 30, 2021
e04a4bc
Update main.yml
JLKwong Apr 30, 2021
d46491e
Update main.yml
JLKwong Apr 30, 2021
3313c78
Update main.yml
JLKwong Apr 30, 2021
d8eec73
Update main.yml
JLKwong Apr 30, 2021
a7bf294
Update main.yml
JLKwong Apr 30, 2021
c37178c
Update main.yml
JLKwong Apr 30, 2021
2456868
Update main.yml
JLKwong May 1, 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
60 changes: 60 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: php-apache-test

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

jobs:
php-apache-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 php-apache
run: |
export DOCKER_CLI_EXPERIMENTAL=enabled
repo="jleekwong/php-apache"
base="treehouses/apache"
source .github/workflows/utils.sh
php_apache_arm_sha=$(get_manifest_sha "$repo:latest" "arm")
echo $php_apache_arm_sha
apache_arm_sha=$(get_manifest_sha "$base:latest" "arm")
echo $apache_arm_sha
flag_arm=$(is_base "$base@"$apache_arm_sha "$repo@"$php_apache_arm_sha)
echo $flag_arm
php_apache_amd64_sha=$(get_manifest_sha "$repo:latest" "amd64")
echo $php_apache_amd64_sha
apache_amd64_sha=$(get_manifest_sha "$base:latest" "amd64")
echo $apache_amd64_sha
flag_amd64=$(is_base "$base@"$apache_amd64_sha "$repo@"$php_apache_amd64_sha)
echo $flag_amd64
php_apache_arm64_sha=$(get_manifest_sha "$repo:latest" "arm64")
echo $php_apache_arm64_sha
apache_arm64_sha=$(get_manifest_sha "$base:latest" "arm64")
echo $apache_arm64_sha
flag_arm64=$(is_base "$base@"$apache_arm64_sha "$repo@"$php_apache_arm64_sha)
echo $flag_arm64
flag=$(compare "$base@"$apache_arm_sha "$repo@"$php_apache_arm_sha "$base@"$apache_amd64_sha "$repo@"$php_apache_amd64_sha "treehouses/apache@"$apache_arm64_sha "$repo@"$php_apache_arm64_sha)
echo $flag
if [[ $flag == true ]]; then
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
build_image "$base:latest" arm "$repo"
build_image "$base:latest" amd64 "$repo"
build_image "$base:latest" arm64 "$repo"
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.