chore(deps): update docker/setup-buildx-action action to v3.8.0 (#169) #454
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: Build OCI Image | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
permissions: | |
contents: none | |
jobs: | |
build: | |
name: Build ${{ matrix.variant.name }} image | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
strategy: | |
fail-fast: false | |
matrix: | |
variant: | |
- name: Alpine | |
tag: alpine | |
dockerfile: Dockerfile.alpine | |
- name: Ubuntu | |
tag: ubuntu | |
dockerfile: Dockerfile | |
steps: | |
- name: Check out code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Login to GHCR | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: https://ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
if: ${{ github.event_name != 'pull_request' }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 | |
- name: Set up Docker Metadata | |
id: meta | |
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1 | |
with: | |
images: ghcr.io/${{ github.repository }} | |
flavor: | | |
latest=auto | |
prefix=${{ matrix.variant.tag }}-,onlatest=true | |
tags: | | |
type=edge | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: Build and push | |
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0 | |
with: | |
push: ${{ github.event_name != 'pull_request' }} | |
cache-from: type=gha,scope=${{ matrix.variant.tag }} | |
cache-to: type=gha,mode=max,scope=${{ matrix.variant.tag }} | |
context: . | |
file: ${{ matrix.variant.dockerfile }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
devcontainer: | |
name: Build devcontainer image | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Check out code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 | |
- name: Install @devcontainers/cli | |
run: npm install -g @devcontainers/cli | |
- name: Build image | |
run: devcontainer build --workspace-folder . | |
- name: Start image | |
run: devcontainer up --workspace-folder . --id-label codespace=tfhttp | |
- name: Build | |
run: | | |
devcontainer exec --workspace-folder . --id-label codespace=tfhttp -- sh -c ' | |
cd /workspaces/tfhttp && \ | |
cmake -B /tmp/build -DCMAKE_BUILD_TYPE=Release -DBUILD_MOSTLY_STATIC_BINARY=off && \ | |
cmake --build /tmp/build' | |
- name: Clean up | |
if: always() | |
run: | | |
ID=$(docker ps -q --filter label=codespace=tfhttp) | |
if [ -n "${ID}" ]; then | |
docker container stop "${ID}" | |
docker container rm "${ID}" | |
fi |