From 7041d8f35dcab3390ac7cc850b2bf66b4ee95986 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Thu, 3 Oct 2019 16:33:09 +0900 Subject: [PATCH 1/3] Add action.yml for Actions v2 --- action.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 action.yml diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..c1bfe5a --- /dev/null +++ b/action.yml @@ -0,0 +1,9 @@ +name: 'Docker Hub Description' +author: 'Peter Evans' +description: 'An action to update a Docker Hub repository description from README.md' +runs: + using: 'docker' + image: 'docker://peterevans/dockerhub-description:2.1.0' +branding: + icon: 'upload' + color: 'blue' From 97941981d14b7b9225aab9f93fee2f2ed83993de Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Thu, 3 Oct 2019 16:38:36 +0900 Subject: [PATCH 2/3] Update workflow --- .github/workflows/push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index c35202f..3eaeb28 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -7,7 +7,7 @@ jobs: dockerHubDescription: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v1 - name: Docker Hub Description uses: ./ env: From 861e7a6d6abe37db6e2f121e5ad502c7f073cc7c Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Thu, 3 Oct 2019 16:39:54 +0900 Subject: [PATCH 3/3] Remove circleci config --- .circleci/config.yml | 70 -------------------------------------------- 1 file changed, 70 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 64cbfca..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,70 +0,0 @@ -version: 2.1 -executors: - docker-executor: - environment: - IMAGE_NAME: peterevans/dockerhub-description - docker: - - image: circleci/buildpack-deps:stretch -jobs: - build: - executor: docker-executor - steps: - - checkout - - setup_remote_docker: - docker_layer_caching: true - - run: - name: Build Docker image - command: | - docker build -t $IMAGE_NAME:latest . --label "org.opencontainers.image.version=${CIRCLE_TAG/v/''}" - - run: - name: Cache Docker image - command: docker save -o image.tar $IMAGE_NAME - - persist_to_workspace: - root: . - paths: - - ./image.tar - publish-tag: - executor: docker-executor - steps: - - attach_workspace: - at: /tmp/workspace - - setup_remote_docker - - run: - name: Load cached Docker image - command: docker load -i /tmp/workspace/image.tar - - run: - name: Publish Docker Image to Docker Hub - command: | - echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin - IMAGE_TAG=${CIRCLE_TAG/v/''} - docker tag $IMAGE_NAME:latest $IMAGE_NAME:$IMAGE_TAG - docker push $IMAGE_NAME:latest - docker push $IMAGE_NAME:$IMAGE_TAG - # If the minor version can be extracted then tag and push - MINOR_VERSION=$(echo $CIRCLE_TAG | sed -n "s/^v\([0-9]*.[0-9]*\).[0-9]*$/\1/p") - if [[ ${#MINOR_VERSION} -gt 0 ]]; then - docker tag $IMAGE_NAME:latest $IMAGE_NAME:$MINOR_VERSION - docker push $IMAGE_NAME:$MINOR_VERSION - fi -workflows: - version: 2 - build: - jobs: - - build - build-and-publish-tags: - jobs: - - build: - filters: - tags: - only: /^v.*/ - branches: - ignore: /.*/ - - publish-tag: - context: org-global - requires: - - build - filters: - tags: - only: /^v.*/ - branches: - ignore: /.*/ \ No newline at end of file