2024-06-18 11:42:33 +02:00
|
|
|
---
|
2024-06-08 12:05:22 +02:00
|
|
|
name: 'Build container images'
|
2024-05-23 09:05:31 +02:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths:
|
|
|
|
- 'container/**'
|
2024-05-26 08:01:11 +02:00
|
|
|
- '.github/workflows/build-container.yml'
|
2024-06-19 08:44:51 +02:00
|
|
|
tags-ignore:
|
|
|
|
- 'eslint-config@v*'
|
|
|
|
- 'prettier-config@v*'
|
2024-05-23 09:05:31 +02:00
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- 'container/**'
|
2024-05-26 08:01:11 +02:00
|
|
|
- '.github/workflows/build-container.yml'
|
2024-05-23 09:05:31 +02:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
env:
|
|
|
|
REGISTRY: ghcr.io
|
|
|
|
IMAGE_NAME: ${{ github.repository }}/lighthouse-ci-server
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
container-build:
|
2024-06-08 12:05:22 +02:00
|
|
|
name: 'Build and publish containers to GitHub Container Registry'
|
2024-05-23 09:05:31 +02:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: write
|
|
|
|
attestations: write
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-06-08 12:05:22 +02:00
|
|
|
- name: 'Checkout the repository'
|
2024-05-23 09:18:36 +02:00
|
|
|
uses: actions/checkout@v4
|
2024-06-08 12:05:22 +02:00
|
|
|
- name: 'Log in to the Container registry'
|
2024-06-08 05:04:55 +02:00
|
|
|
uses: docker/login-action@v3.2.0
|
2024-05-23 09:05:31 +02:00
|
|
|
with:
|
|
|
|
registry: ${{ env.REGISTRY }}
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2024-06-08 12:05:22 +02:00
|
|
|
- name: 'Extract metadata (tags, labels) for Docker'
|
2024-05-23 09:05:31 +02:00
|
|
|
id: meta
|
2024-06-08 05:04:55 +02:00
|
|
|
uses: docker/metadata-action@v5.5.1
|
2024-05-23 09:05:31 +02:00
|
|
|
with:
|
|
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
2024-06-08 12:05:22 +02:00
|
|
|
- name: 'Build and push Docker image'
|
2024-05-23 09:05:31 +02:00
|
|
|
id: push
|
2024-06-18 17:19:39 +02:00
|
|
|
uses: docker/build-push-action@v5.4.0
|
2024-05-23 09:05:31 +02:00
|
|
|
with:
|
2024-05-23 09:15:11 +02:00
|
|
|
context: ${{ github.workspace }}/container/lighthouse-ci-server
|
|
|
|
file: ${{ github.workspace }}/container/lighthouse-ci-server/Dockerfile
|
2024-05-23 09:05:31 +02:00
|
|
|
push: true
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|