From 600e132fb6cf9ec6819ca968b66dfe41fd516980 Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Wed, 19 Oct 2022 11:10:50 +1100 Subject: [PATCH] Actions use built docker-images --- .../docker-release-github-action.yml | 63 ------------------- .github/workflows/docker-release.yml | 20 ++++++ 2 files changed, 20 insertions(+), 63 deletions(-) delete mode 100644 .github/workflows/docker-release-github-action.yml diff --git a/.github/workflows/docker-release-github-action.yml b/.github/workflows/docker-release-github-action.yml deleted file mode 100644 index 4c346e9ba4c..00000000000 --- a/.github/workflows/docker-release-github-action.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Release Github action Docker - -on: - release: - types: [released] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - publishDocker: - environment: dockerhub - env: - IMAGE_NAME: mikefarah/yq - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - with: - platforms: all - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - with: - version: latest - - - name: Available platforms - run: echo ${{ steps.buildx.outputs.platforms }} && docker version - - - name: Build and push image - run: | - echo "GithubRef: ${GITHUB_REF}" - VERSION=${GITHUB_REF##*/} - echo "VERSION: ${VERSION}" - IMAGE_VERSION=${VERSION:1} - echo "IMAGE_VERSION: ${IMAGE_VERSION}" - - PLATFORMS="linux/amd64,linux/ppc64le,linux/arm64" - - echo "Building and pushing version ${IMAGE_VERSION} of image ${IMAGE_NAME}" - echo '${{ secrets.DOCKER_PASSWORD }}' | docker login -u '${{ secrets.DOCKER_USERNAME }}' --password-stdin - cd github-action - docker buildx build \ - --label "org.opencontainers.image.authors=https://github.com/mikefarah/yq/graphs/contributors" \ - --label "org.opencontainers.image.created=$(date --rfc-3339=seconds)" \ - --label "org.opencontainers.image.description=yq is a portable command-line YAML processor" \ - --label "org.opencontainers.image.documentation=https://mikefarah.gitbook.io/yq/" \ - --label "org.opencontainers.image.licenses=MIT" \ - --label "org.opencontainers.image.revision=$(git rev-parse HEAD)" \ - --label "org.opencontainers.image.source=https://github.com/mikefarah/yq" \ - --label "org.opencontainers.image.title=yq" \ - --label "org.opencontainers.image.url=https://mikefarah.gitbook.io/yq/" \ - --label "org.opencontainers.image.version=${IMAGE_VERSION}" \ - --platform "${PLATFORMS}" \ - --pull \ - --push \ - -t "${IMAGE_NAME}:${IMAGE_VERSION}-githubaction" \ - -t "${IMAGE_NAME}:4-githubaction" \ - -t "${IMAGE_NAME}:latest-githubaction" \ - . diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index 56796236846..17890b27489 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -60,3 +60,23 @@ jobs: -t "${IMAGE_NAME}:4" \ -t "${IMAGE_NAME}:latest" \ . + + cd github-action + docker buildx build \ + --label "org.opencontainers.image.authors=https://github.com/mikefarah/yq/graphs/contributors" \ + --label "org.opencontainers.image.created=$(date --rfc-3339=seconds)" \ + --label "org.opencontainers.image.description=yq is a portable command-line YAML processor" \ + --label "org.opencontainers.image.documentation=https://mikefarah.gitbook.io/yq/" \ + --label "org.opencontainers.image.licenses=MIT" \ + --label "org.opencontainers.image.revision=$(git rev-parse HEAD)" \ + --label "org.opencontainers.image.source=https://github.com/mikefarah/yq" \ + --label "org.opencontainers.image.title=yq" \ + --label "org.opencontainers.image.url=https://mikefarah.gitbook.io/yq/" \ + --label "org.opencontainers.image.version=${IMAGE_VERSION}" \ + --platform "${PLATFORMS}" \ + --pull \ + --push \ + -t "${IMAGE_NAME}:${IMAGE_VERSION}-githubaction" \ + -t "${IMAGE_NAME}:4-githubaction" \ + -t "${IMAGE_NAME}:latest-githubaction" \ + .