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
|
|
|
|
|
|
|
|
jobs:
|
2024-07-04 12:49:20 +02:00
|
|
|
lighthouse-ci-build:
|
|
|
|
name: 'Build and publish lhci to GitHub Container Registry'
|
|
|
|
env:
|
|
|
|
IMAGE_NAME: ${{ github.repository }}/lighthouse-ci-server
|
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-07-03 13:03:33 +02:00
|
|
|
uses: docker/build-push-action@v6.3.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 }}
|
2024-07-04 12:49:20 +02:00
|
|
|
copybara-build:
|
|
|
|
name: 'Build and publish copybara to GitHub Container Registry'
|
|
|
|
env:
|
|
|
|
IMAGE_NAME: ${{ github.repository }}/copybara
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: write
|
|
|
|
attestations: write
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout the repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
submodules: 'true'
|
|
|
|
- name: 'Log in to the Container registry'
|
|
|
|
uses: docker/login-action@v3.2.0
|
|
|
|
with:
|
|
|
|
registry: ${{ env.REGISTRY }}
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: 'Extract metadata (tags, labels) for Docker'
|
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v5.5.1
|
|
|
|
with:
|
|
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
|
|
- name: 'Build and push Docker image'
|
|
|
|
id: push
|
|
|
|
uses: docker/build-push-action@v6.3.0
|
|
|
|
with:
|
|
|
|
context: ${{ github.workspace }}/container/copybara
|
|
|
|
file: ${{ github.workspace }}/container/copybara/Dockerfile
|
|
|
|
push: true
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|