misc: Fix docker-build.yaml (#1588)

This is an attempt to get the docker build workflow working
This commit is contained in:
Bobby R. Bruce
2024-09-21 07:08:12 -07:00
committed by GitHub
parent 51b5279671
commit cae4852606

View File

@@ -1,54 +1,39 @@
---
name: Docker images build and push
#on:
# push:
# branches:
# - 'develop'
# paths:
# - util/dockerfiles/**
on:
workflow_dispatch:
jobs:
obtain-dockerfiles:
bake:
runs-on: [self-hosted, linux, x64]
container: ghcr.io/gem5/ubuntu-24.04_all-dependencies:latest
steps:
- uses: actions/checkout@v4
with:
# Scheduled workflows run on the default branch by default. We
# therefore need to explicitly checkout the develop branch.
ref: develop
- uses: actions/upload-artifact@v4
with:
name: dockerfiles
path: util/dockerfiles
# This builds and pushes the docker image.
build-and-push:
runs-on: [self-hosted, linux, x64]
needs: obtain-dockerfiles
permissions:
packages: write
contents: read
steps:
- uses: actions/download-artifact@v4
with:
name: dockerfiles
path: dockerfiles-docker-build
- name: Checkout
uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v2
name: Setup QEMU
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- uses: docker/setup-buildx-action@v2
name: Set up Docker Buildx
- uses: docker/login-action@v2
name: Login to the GitHub Container Registry
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push with bake
uses: docker/bake-action@v4
- name: Build and push
uses: docker/bake-action@v5
with:
workdir: ./dockerfiles-docker-build
files: docker-bake.hcl
workdir: util/dockerfiles
push: true