chore: add Git commit sha to container labels #224
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: {} | |
concurrency: | |
group: ${{ format('{0}/{1}', github.repository_owner, github.ref) }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the source code | |
uses: actions/checkout@v4 | |
- name: Run the custom linter | |
run: ./lint.sh | |
build: | |
name: Build images | |
runs-on: ubuntu-latest | |
needs: [lint] | |
# Use the same job to build all Linux-based images | |
strategy: | |
matrix: | |
image: | |
- linux | |
- linux-micro | |
steps: | |
- name: Checkout the source code | |
uses: actions/checkout@v4 | |
- name: Authenticate with GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: ${{ matrix.image }}/ | |
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | |
tags: | | |
ghcr.io/${{ github.repository }}/${{ matrix.image }}:latest | |
ghcr.io/${{ github.repository }}/${{ matrix.image }}:${{ github.sha }} |