@@ -38,12 +38,11 @@ jobs:
3838 # Meaning of the various items in the matrix list
3939 # 0: Container name (e.g. ubuntu-bionic)
4040 # 1: Platforms to build for
41- # 2: Base image (e.g. ubuntu:18 .04)
41+ # 2: Base image (e.g. ubuntu:22 .04)
4242 dockerfile : [[amazon-linux, 'linux/amd64,linux/arm64', 'amazonlinux:2'],
4343 [centos7, 'linux/amd64,linux/arm64,linux/ppc64le', 'centos:7'],
4444 [centos-stream, 'linux/amd64,linux/arm64,linux/ppc64le', 'centos:stream'],
4545 [leap15, 'linux/amd64,linux/arm64,linux/ppc64le', 'opensuse/leap:15'],
46- [ubuntu-bionic, 'linux/amd64,linux/arm64,linux/ppc64le', 'ubuntu:18.04'],
4746 [ubuntu-focal, 'linux/amd64,linux/arm64,linux/ppc64le', 'ubuntu:20.04'],
4847 [ubuntu-jammy, 'linux/amd64,linux/arm64,linux/ppc64le', 'ubuntu:22.04'],
4948 [almalinux8, 'linux/amd64,linux/arm64,linux/ppc64le', 'almalinux:8'],
@@ -58,18 +57,20 @@ jobs:
5857 - name : Checkout
5958 uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # @v2
6059
61- - name : Set Container Tag Normal (Nightly)
62- run : |
63- container="${{ matrix.dockerfile[0] }}:latest"
64- echo "container=${container}" >> $GITHUB_ENV
65- echo "versioned=${container}" >> $GITHUB_ENV
66-
67- # On a new release create a container with the same tag as the release.
68- - name : Set Container Tag on Release
69- if : github.event_name == 'release'
70- run : |
71- versioned="${{matrix.dockerfile[0]}}:${GITHUB_REF##*/}"
72- echo "versioned=${versioned}" >> $GITHUB_ENV
60+ - uses : docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934
61+ id : docker_meta
62+ with :
63+ images : |
64+ ghcr.io/${{ github.repository_owner }}/${{ matrix.dockerfile[0] }}
65+ ${{ github.repository_owner }}/${{ matrix.dockerfile[0] }}
66+ tags : |
67+ type=schedule,pattern=nightly
68+ type=schedule,pattern=develop
69+ type=semver,pattern={{version}}
70+ type=semver,pattern={{major}}.{{minor}}
71+ type=semver,pattern={{major}}
72+ type=ref,event=branch
73+ type=ref,event=pr
7374
7475 - name : Generate the Dockerfile
7576 env :
@@ -92,35 +93,32 @@ jobs:
9293 path : dockerfiles
9394
9495 - name : Set up QEMU
95- uses : docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # @v1
96+ uses : docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3
9697
9798 - name : Set up Docker Buildx
98- uses : docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # @v1
99+ uses : docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226
99100
100101 - name : Log in to GitHub Container Registry
101- uses : docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # @v1
102+ uses : docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
102103 with :
103104 registry : ghcr.io
104105 username : ${{ github.actor }}
105106 password : ${{ secrets.GITHUB_TOKEN }}
106107
107108 - name : Log in to DockerHub
108109 if : github.event_name != 'pull_request'
109- uses : docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # @v1
110+ uses : docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
110111 with :
111112 username : ${{ secrets.DOCKERHUB_USERNAME }}
112113 password : ${{ secrets.DOCKERHUB_TOKEN }}
113114
114115 - name : Build & Deploy ${{ matrix.dockerfile[0] }}
115- uses : docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # @v2
116+ uses : docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
116117 with :
117118 context : dockerfiles/${{ matrix.dockerfile[0] }}
118119 platforms : ${{ matrix.dockerfile[1] }}
119120 push : ${{ github.event_name != 'pull_request' }}
120121 cache-from : type=gha
121122 cache-to : type=gha,mode=max
122- tags : |
123- spack/${{ env.container }}
124- spack/${{ env.versioned }}
125- ghcr.io/spack/${{ env.container }}
126- ghcr.io/spack/${{ env.versioned }}
123+ tags : ${{ steps.docker_meta.outputs.tags }}
124+ labels : ${{ steps.docker_meta.outputs.labels }}
0 commit comments