Skip to content

Update Cogs to have Stats #57

Update Cogs to have Stats

Update Cogs to have Stats #57

Workflow file for this run

on:
push:
branches: [ "main", "master" ]
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "main", "master" ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get commit SHA
id: commit_sha
run: echo "::set-output name=sha::$(echo ${GITHUB_SHA})"
- name: Setup Docker buildx
uses: docker/[email protected]
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Convert IMAGE_NAME to lowercase
id: image_name_lowercase
run: echo "::set-output name=image_name_lowercase::$(echo ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | tr '[:upper:]' '[:lower:]')"
- name: Build and push Docker image
id: build-and-push
uses: docker/[email protected]
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ steps.image_name_lowercase.outputs.image_name_lowercase }}:latest
${{ steps.image_name_lowercase.outputs.image_name_lowercase }}:${{ steps.commit_sha.outputs.sha }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
COMMIT_SHA=${{ steps.commit_sha.outputs.sha }}
IMAGE_NAME=${{ steps.image_name_lowercase.outputs.image_name_lowercase }}:${{ steps.commit_sha.outputs.sha }}