Build CI Service Images #1
This file contains hidden or 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: Build CI Service Images | |
run-name: Build CI Service Images | |
on: | |
push: | |
paths: | |
- .github/services/Dockerfile.* | |
- fixtures/etcdcerts/*.pem | |
branches: | |
- master | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: gravitational/ci-etcd | |
ETCD_VERSION: 3.3.9 | |
jobs: | |
build: | |
name: Build CI Services Images | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout Teleport | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 | |
- name: Login to registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.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@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
- name: Build etcd image | |
id: docker_build | |
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0 | |
with: | |
context: ${{ github.workspace }} | |
file: .github/services/Dockerfile.etcd | |
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.ETCD_VERSION }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: | | |
ETCD_VERSION=${{ env.ETCD_VERSION }} | |
push: true | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |