use image id for analysis. #72
This file contains hidden or 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
| name: build | |
| on: | |
| push: | |
| branches: | |
| - '*' | |
| jobs: | |
| build: | |
| if: "!contains(github.event.head_commit.message, 'skip ci')" | |
| runs-on: ubuntu-latest | |
| env: | |
| DOCKER_REGISTRY: docker.io | |
| ORGANISATION_NAME: aemdesign | |
| DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
| DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
| SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} | |
| JDK_DRIVEID: ${{ secrets.JDK17_ORACLE_DRIVEID }} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: set envirnment variables | |
| id: config | |
| run: | | |
| source <(curl -sL https://github.com/aem-design/aemdesign-docker/releases/latest/download/github_get_config.sh) | |
| source <(curl -sL https://github.com/aem-design/aemdesign-docker/releases/latest/download/github_get_version.sh) | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v1 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v1 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v1 | |
| with: | |
| username: ${{ env.DOCKER_USERNAME }} | |
| password: ${{ env.DOCKER_PASSWORD }} | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v1 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Download Files from Google Drive | |
| uses: docker://gvfn/gdrive | |
| with: | |
| entrypoint: "/bin/sh" | |
| args: | | |
| -c "\ | |
| gdrive --config /gdrive --service-account-evar SERVICE_ACCOUNT_JSON download --path /github/workspace/packages/ ${JDK_DRIVEID} | |
| - name: Build and export to Docker | |
| id: docker_build | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: . | |
| platforms: linux/amd64 | |
| load: true | |
| build-args: | | |
| "FILE_NAME=jdk-17.0.14_linux-x64_bin.tar.gz" | |
| tags: | | |
| ${{ env.IMAGE }}:${{ env.GIT_BRANCH }} | |
| ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:${{ env.GIT_BRANCH }} | |
| - name: test docker image | |
| run: | | |
| cd test && bash ./run_tests.sh "ghcr.io/$GITHUB_REPOSITORY_OWNER/$IMAGE:$GIT_BRANCH" | |
| - name: Run docker image analysis | |
| uses: yuichielectric/dive-action@0.0.4 | |
| with: | |
| image: ${{ steps.docker_build.outputs.imageid }} | |
| config-file: ${{ env.GITHUB_WORKSPACE }}/.dive-ci.yml | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: . | |
| platforms: linux/amd64 | |
| push: true | |
| build-args: | | |
| "JDK_DRIVEID=${{ env.JDK_DRIVEID }}" | |
| tags: | | |
| ${{ env.IMAGE }}:${{ env.GIT_BRANCH }} | |
| ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE }}:${{ env.GIT_BRANCH }} | |
| - name: Update Docker Hub Description | |
| uses: peter-evans/dockerhub-description@v2 | |
| continue-on-error: true | |
| with: | |
| username: ${{ env.DOCKER_USERNAME }} | |
| password: ${{ env.DOCKER_PASSWORD }} | |
| repository: peterevans/dockerhub-description | |
| - uses: meeDamian/github-release@1.0 | |
| if: github.ref == 'refs/heads/master' | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| tag: ${{ env.GITHUB_TAG }} | |
| name: ${{ env.GITHUB_TAG }} | |
| body: ${{ env.GIT_RELEASE_NOTES }} |