From 44225ccf3d5d411a27384f9c871018da2003aeaf Mon Sep 17 00:00:00 2001 From: Neethu-Mohan Date: Thu, 12 Aug 2021 01:13:15 -0400 Subject: [PATCH 1/3] Create webssh.yml --- .github/workflows/webssh.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/webssh.yml diff --git a/.github/workflows/webssh.yml b/.github/workflows/webssh.yml new file mode 100644 index 0000000..f937a06 --- /dev/null +++ b/.github/workflows/webssh.yml @@ -0,0 +1,36 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ master ] + pull_request: + branches: [ master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Runs a single command using the runners shell + - name: Run a one-line script + run: echo Hello, world! + + # Runs a set of commands using the runners shell + - name: Run a multi-line script + run: | + echo Add other actions to build, + echo test, and deploy your project. From 9af4aa9efea155569aadfffb8e4567959308f92f Mon Sep 17 00:00:00 2001 From: Neethu Date: Thu, 12 Aug 2021 03:19:11 -0400 Subject: [PATCH 2/3] updated github action file --- .github/workflows/webssh.yml | 68 ++++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 26 deletions(-) diff --git a/.github/workflows/webssh.yml b/.github/workflows/webssh.yml index f937a06..14b4ac5 100644 --- a/.github/workflows/webssh.yml +++ b/.github/workflows/webssh.yml @@ -1,36 +1,52 @@ -# This is a basic workflow to help you get started with Actions +name: build on change -name: CI - -# Controls when the workflow will run on: - # Triggers the workflow on push or pull request events but only for the master branch push: - branches: [ master ] - pull_request: - branches: [ master ] - - # Allows you to run this workflow manually from the Actions tab + branches: + - master + - main workflow_dispatch: + repository_dispatch: + types: webssh -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job + compare: + runs-on: ubuntu-latest + outputs: + flag: ${{ steps.set-flag.outputs.flag }} + strategy: + fail-fast: false + matrix: + arch: [amd64, arm, arm64] steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - name: checkoutrepository + uses: actions/checkout@v2 + - name: container registries + run: | + docker login docker.io -u ${{ secrets.DOCKERUSERNAME }} -p ${{ secrets.DOCKERAPIKEY }} + - name: compare image + id: set-flag + run: | + export DOCKER_CLI_EXPERIMENTAL=enabled + version="latest" + repo="neethumohan1212/webssh-tags:${{ matrix.arch }}" + case ${{ matrix.arch }} in + amd64) : "neethumohan1212/alpine:$version" ;; + arm) : "neethumohan1212/alpine:$version" ;; + arm64) : "neethumohan1212/alpine:$version" ;; + esac + base="$_" + docker pull -q $base &>/dev/null + docker pull -q $repo &>/dev/null + basesha=$(docker image inspect $base | jq --raw-output '.[0].RootFS.Layers|.[]') + reposha=$(docker image inspect $repo | jq --raw-output '.[0].RootFS.Layers|.[]') + echo "base sha:$basesha repo sha:$reposha" + [[ $reposha == *$basesha* ]] && echo "no changes" || echo "::set-output name=flag::true" - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo Hello, world! - # Runs a set of commands using the runners shell - - name: Run a multi-line script - run: | - echo Add other actions to build, - echo test, and deploy your project. + + + source .github/workflows/utils.sh + echo "amd64" + debian_x86_sha=$(get_variant_sha "debian" "latest" "amd64") \ No newline at end of file From 51cf33d66e7b31065188f5fcd8d425f4d04a253e Mon Sep 17 00:00:00 2001 From: Neethu Date: Thu, 12 Aug 2021 03:34:01 -0400 Subject: [PATCH 3/3] webssh.yml modified --- .github/workflows/webssh.yml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/webssh.yml b/.github/workflows/webssh.yml index 14b4ac5..c5c8e6b 100644 --- a/.github/workflows/webssh.yml +++ b/.github/workflows/webssh.yml @@ -37,16 +37,9 @@ jobs: arm64) : "neethumohan1212/alpine:$version" ;; esac base="$_" - docker pull -q $base &>/dev/null - docker pull -q $repo &>/dev/null - basesha=$(docker image inspect $base | jq --raw-output '.[0].RootFS.Layers|.[]') - reposha=$(docker image inspect $repo | jq --raw-output '.[0].RootFS.Layers|.[]') - echo "base sha:$basesha repo sha:$reposha" - [[ $reposha == *$basesha* ]] && echo "no changes" || echo "::set-output name=flag::true" - - - - - source .github/workflows/utils.sh - echo "amd64" - debian_x86_sha=$(get_variant_sha "debian" "latest" "amd64") \ No newline at end of file + # docker pull -q $base &>/dev/null + # docker pull -q $repo &>/dev/null + # basesha=$(docker image inspect $base | jq --raw-output '.[0].RootFS.Layers|.[]') + # reposha=$(docker image inspect $repo | jq --raw-output '.[0].RootFS.Layers|.[]') + # echo "base sha:$basesha repo sha:$reposha" + # [[ $reposha == *$basesha* ]] && echo "no changes" || echo "::set-output name=flag::true"