Update workflow.yml

This commit is contained in:
linguist
2021-01-02 14:46:46 +01:00
parent efec77e3ab
commit 7da310c020
2 changed files with 36 additions and 18 deletions

View File

@@ -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
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

View File

@@ -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