-
Notifications
You must be signed in to change notification settings - Fork 3
32 lines (28 loc) · 1.15 KB
/
container.yml
File metadata and controls
32 lines (28 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Build & Push Container
on:
# This Workflow can be triggered manually
workflow_dispatch:
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
- name: Login to GitHub Container Registry
if: github.ref == 'refs/heads/develop'
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build & Push
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
with:
context: .
platforms: linux/amd64
push: ${{ github.ref == 'refs/heads/develop' }}
tags: ghcr.io/spack/spack-distroless:latest
cache-from: type=registry,ref=ghcr.io/spack/spack-distroless:buildcache
cache-to: ${{ github.ref == 'refs/heads/develop' && 'type=registry,ref=ghcr.io/spack/spack-distroless:buildcache,mode=max' || '' }}