-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add automated build for component container (#1)
* add automated build for component container Signed-off-by: vsoch <vsoch@users.noreply.github.com>
- Loading branch information
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: flux-operator-component container build | ||
on: | ||
# This must be triggered manually | ||
workflow_dispatch: | ||
|
||
# If you dare test for a PR | ||
# This will take ~4 hours 25 minutes | ||
pull_request: [] | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
container: ghcr.io/converged-computing/flux-operator-component | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
strategy: | ||
fail-fast: false | ||
|
||
# In case in the future we want different arches? | ||
matrix: | ||
platform: | ||
- [linux, latest] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.container }} | ||
|
||
- name: Make Space For Build | ||
run: | | ||
sudo rm -rf /usr/share/dotnet | ||
sudo rm -rf /opt/ghc | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: ${{ matrix.platform[0] }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login GitHub packages | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
id: build | ||
uses: docker/build-push-action@v3 | ||
with: | ||
file: Dockerfile | ||
push: ${{ github.event_name != 'pull_request' }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
platforms: ${{ matrix.platform[0] }} | ||
tags: | | ||
${{ env.container }}:${{ matrix.platform[1] }} | ||