-
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@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2
- 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@1dc73863535b631f98b2378be8619f83b136f4a0
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' || '' }}