From 7da310c020a2fb2ce337bf52cd27122fbac799a6 Mon Sep 17 00:00:00 2001 From: linguist <22963968+lowlighter@users.noreply.github.com> Date: Sat, 2 Jan 2021 14:46:46 +0100 Subject: [PATCH] Update workflow.yml --- .github/workflows/workflow.yml | 50 +++++++++++++++++++++++----------- action.yml | 4 +-- 2 files changed, 36 insertions(+), 18 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index df19cecb..9e2e3692 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -71,20 +71,38 @@ jobs: use_mocked_data: yes verify: yes - # TODO - # ========================= # Build docker image from master and publish it to GitHub registry with release tag - #docker-release: - # name: Publish release to GitHub registry - # runs-on: ubuntu-latest - # needs: [ build, analyze, action-master-test ] - # if: github.event_name == 'push' && github.ref == 'refs/heads/master' && contains(github.event.head_commit.message, '[release]') - # steps: - # - name: Checkout repository - # uses: actions/checkout@v2 - # - name: Login to GitHub registry - # run: echo ${{ secrets.CONTAINER_REGISTRY_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin - # - name: Build docker image - # run: docker build -t ghcr.io/lowlighter/metrics:master . - # - name: Publish to GitHub registry - # run: docker push ghcr.io/lowlighter/metrics:master \ No newline at end of file + docker-release: + name: Publish release to GitHub registry + runs-on: ubuntu-latest + needs: [ build, analyze, action-master-test ] + if: github.event_name == 'push' && github.ref == 'refs/heads/master' && contains(github.event.head_commit.message, '[release]') + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Login to GitHub registry + run: echo ${{ secrets.CONTAINER_REGISTRY_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin + - name: Tag docker image (release) + run: docker tag ghcr.io/lowlighter/metrics:master ghcr.io/lowlighter/metrics:$(echo '${{ github.event.head_commit.message }}' | grep -Po 'v\d+[.]\d+') + - name: Publish release to GitHub registry + run: docker push ghcr.io/lowlighter/metrics:$(echo '${{ github.event.head_commit.message }}' | grep -Po 'v\d+[.]\d+') + - name: Tag docker image (latest) + run: docker tag ghcr.io/lowlighter/metrics:master ghcr.io/lowlighter/metrics:latest + - name: Publish latest to GitHub registry + run: docker push ghcr.io/lowlighter/metrics:latest + + # Test lowlighter/metrics@latest + action-lastest-test: + name: Test lowlighter/metrics@latest + runs-on: ubuntu-latest + needs: [ docker-release ] + if: github.event_name == 'push' && github.ref == 'refs/heads/master' && contains(github.event.head_commit.message, '[release]') + steps: + - name: Run tests + uses: lowlighter/metrics@latest + with: + token: MOCKED_TOKEN + plugins_errors_fatal: yes + dryrun: yes + use_mocked_data: yes + verify: yes diff --git a/action.yml b/action.yml index e6ddb360..50cda9f0 100644 --- a/action.yml +++ b/action.yml @@ -386,9 +386,9 @@ inputs: # ==================================================================================== # Action metadata -name: Metrics +name: GitHub metrics as SVG image author: lowlighter -description: An image generator with 20+ metrics about your GitHub account such as activity, community, repositories, coding habits, website performances, music played, starred topics, etc. that you can put on your profile or elsewhere ! +description: An SVG generator with 20+ metrics about your GitHub account! Additional plugins are available to display even more! branding: icon: user-check color: gray-dark