Remove CI/CD badge from README (#40) #138
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: Publish to Dockerhub and GitHub packages | |
| on: push # [push, pull_request] | |
| jobs: | |
| benchmark: | |
| runs-on: ubuntu-20.04 | |
| steps: | |
| - uses: actions/checkout@v1 | |
| - name: benchmarks the go code | |
| run: make benchmark | |
| test: | |
| runs-on: ubuntu-20.04 | |
| steps: | |
| - uses: actions/checkout@v1 | |
| - name: tests the code | |
| run: make test | |
| # https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#example-printing-context-information-to-the-log-file @ 2020 07 19 | |
| context_information: | |
| needs: [benchmark, test] | |
| runs-on: ubuntu-20.04 | |
| steps: | |
| - name: Dump GitHub context | |
| env: | |
| GITHUB_CONTEXT: ${{ toJson(github) }} | |
| run: echo "$GITHUB_CONTEXT" | |
| - name: Dump job context | |
| env: | |
| JOB_CONTEXT: ${{ toJson(job) }} | |
| run: echo "$JOB_CONTEXT" | |
| - name: Dump steps context | |
| env: | |
| STEPS_CONTEXT: ${{ toJson(steps) }} | |
| run: echo "$STEPS_CONTEXT" | |
| - name: Dump runner context | |
| env: | |
| RUNNER_CONTEXT: ${{ toJson(runner) }} | |
| run: echo "$RUNNER_CONTEXT" | |
| - name: Dump strategy context | |
| env: | |
| STRATEGY_CONTEXT: ${{ toJson(strategy) }} | |
| run: echo "$STRATEGY_CONTEXT" | |
| - name: Dump matrix context | |
| env: | |
| MATRIX_CONTEXT: ${{ toJson(matrix) }} | |
| run: echo "$MATRIX_CONTEXT" | |
| # https://docs.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables @ 2020 07 19 | |
| context_env: | |
| needs: [benchmark, test] | |
| runs-on: ubuntu-20.04 | |
| steps: | |
| - name: Dump GitHub HOME | |
| env: | |
| GHHOME: ${HOME} | |
| run: echo "$GHHOME" | |
| - name: Dump GITHUB_WORKFLOW | |
| env: | |
| GITHUB_WORKFLOW: ${GITHUB_WORKFLOW} | |
| run: echo "$GITHUB_WORKFLOW" | |
| - name: Dump GITHUB_RUN_ID | |
| env: | |
| GITHUB_RUN_ID: ${GITHUB_RUN_ID} | |
| run: echo "$GITHUB_RUN_ID" | |
| - name: Dump GITHUB_RUN_NUMBER | |
| env: | |
| GITHUB_RUN_NUMBER: ${GITHUB_RUN_NUMBER} | |
| run: echo "$GITHUB_RUN_NUMBER" | |
| - name: Dump GITHUB_ACTION | |
| env: | |
| GITHUB_RUN_NUMBER: ${GITHUB_ACTION} | |
| run: echo "$GITHUB_ACTION" | |
| - name: Dump GITHUB_ACTIONS | |
| env: | |
| GITHUB_RUN_NUMBER: ${GITHUB_ACTIONS} | |
| run: echo "$GITHUB_ACTIONS" | |
| - name: Dump GITHUB_ACTOR | |
| env: | |
| GITHUB_RUN_NUMBER: ${GITHUB_ACTOR} | |
| run: echo "$GITHUB_ACTOR" | |
| - name: Dump GITHUB_REPOSITORY | |
| env: | |
| GITHUB_RUN_NUMBER: ${GITHUB_REPOSITORY} | |
| run: echo "$GITHUB_REPOSITORY" | |
| - name: Dump GITHUB_REPOSITORY | |
| env: | |
| GITHUB_RUN_NUMBER: ${GITHUB_REPOSITORY} | |
| run: echo "$GITHUB_REPOSITORY" | |
| - name: Dump GITHUB_EVENT_PATH | |
| env: | |
| GITHUB_RUN_NUMBER: ${GITHUB_EVENT_PATH} | |
| run: echo "$GITHUB_EVENT_PATH" | |
| - name: Dump GITHUB_WORKSPACE | |
| env: | |
| GITHUB_RUN_NUMBER: ${GITHUB_WORKSPACE} | |
| run: echo "$GITHUB_WORKSPACE" | |
| - name: Dump GITHUB_SHA | |
| env: | |
| GITHUB_RUN_NUMBER: ${GITHUB_SHA} | |
| run: echo "$GITHUB_SHA" | |
| - name: Dump GITHUB_REF | |
| env: | |
| GITHUB_RUN_NUMBER: ${GITHUB_REF} | |
| run: echo "$GITHUB_REF" | |
| - name: Dump GITHUB_HEAD_REF | |
| env: | |
| GITHUB_RUN_NUMBER: ${GITHUB_HEAD_REF} | |
| run: echo "$GITHUB_HEAD_REF" | |
| - name: Dump GITHUB_BASE_REF | |
| env: | |
| GITHUB_RUN_NUMBER: ${GITHUB_BASE_REF} | |
| run: echo "$GITHUB_BASE_REF" | |
| - name: Dump GITHUB_SERVER_URL | |
| env: | |
| GITHUB_RUN_NUMBER: ${GITHUB_SERVER_URL} | |
| run: echo "$GITHUB_SERVER_URL" | |
| - name: Dump GITHUB_API_URL | |
| env: | |
| GITHUB_RUN_NUMBER: ${GITHUB_API_URL} | |
| run: echo "$GITHUB_API_URL" | |
| - name: Dump GITHUB_GRAPHQL_URL | |
| env: | |
| GITHUB_RUN_NUMBER: ${GITHUB_GRAPHQL_URL} | |
| run: echo "$GITHUB_GRAPHQL_URL" | |
| push2dockerhub_if_linux: | |
| needs: [benchmark, test] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [macOS-10.15, ubuntu-20.04] | |
| goos: [linux, darwin] | |
| exclude: | |
| - os: macOS-10.15 | |
| goos: linux | |
| - os: ubuntu-20.04 | |
| goos: darwin | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: builds the binary | |
| run: CGO_ENABLED=0 GOOS=${{ matrix.goos }} go build -a -installsuffix cgo -ldflags '-w -extldflags "-static"' -o hello_world${{ matrix.os }}${{ matrix.goos }} . | |
| - uses: actions/checkout@master | |
| - name: if linux build docker image and docker hub login as well as push | |
| if: matrix.os == 'ubuntu-20.04' | |
| env: | |
| DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
| DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
| run: | | |
| # inspired by https://gist.github.com/jonico/e18127b487d198606e31aac669262af8 @ 2019 08 19 | |
| d=$(date +%Y-%m-%d) | |
| tag=$d-${{ matrix.os }}-${{ github.sha }} | |
| docker build -t lotharschulz/hello-github-actions:$tag . | |
| echo ${DOCKER_PASSWORD} | docker login -u ${DOCKER_USERNAME} --password-stdin | |
| docker push lotharschulz/hello-github-actions:$tag | |
| push_to_docker_pkg: | |
| needs: [benchmark, test] | |
| name: build-push-action via docker cli | |
| runs-on: ubuntu-20.04 | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Build and Push | |
| env: | |
| DOCKER_USERNAME: ${{ github.actor }} | |
| DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| echo ${DOCKER_PASSWORD} | docker login https://docker.pkg.github.com -u ${DOCKER_USERNAME} --password-stdin | |
| d=$(date +%Y-%m-%d--%H-%M-%S--%N) | |
| tag=$d-${{ github.sha }} | |
| IMAGE_AND_TAG=docker.pkg.github.com/lotharschulz/hello-github-actions/hello-github-actions-pkg:$tag | |
| docker build -t $IMAGE_AND_TAG . | |
| docker push $IMAGE_AND_TAG | |
| ghcr_push: | |
| needs: [benchmark, test] | |
| name: ghcr push | |
| runs-on: ubuntu-20.04 | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Build and Push | |
| env: | |
| GCR_USERNAME: ${{ github.actor }} | |
| GCR_PASSWORD: ${{ secrets.CR_PAT }} | |
| run: | | |
| echo "${GCR_PASSWORD}" | docker login https://ghcr.io -u ${GCR_USERNAME} --password-stdin | |
| d=$(date +%Y-%m-%d--%H-%M-%S--%N) | |
| tag=$d-${{ github.sha }} | |
| IMAGE_AND_TAG=ghcr.io/lotharschulz/hello-github-actions/hello-github-actions-ghcr:$tag | |
| docker build -t $IMAGE_AND_TAG . | |
| docker push $IMAGE_AND_TAG |