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 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: 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'