File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Deploy
22
3- on :
4- push :
5- # branches: [main]
3+ push :
4+ branches :
5+ - " main"
6+ tags :
7+ - " v*.*.*"
8+
69permissions :
710 packages : write
811
1821 name : Checkout Repository
1922 with :
2023 persist-credentials : false
24+
25+ - name : Docker meta
26+ id : meta
27+ uses : docker/metadata-action@v5
28+ with :
29+ images : |
30+ ghcr.io/uw-midsun/devcontainers/${{ matrix.project }}
31+ tags : |
32+ type=ref,event=branch
33+ type=ref,event=pr
34+ type=semver,pattern={{version}}
35+ type=semver,pattern={{major}}.{{minor}}
36+ type=semver,pattern={{major}}
37+ type=sha
38+
2139 - uses : docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9
2240 name : Container Registry Login
2341 with :
3250 - name : Build and Tag Docker Image
3351 env :
3452 PROJECT : ${{ matrix.project }}
35- VERSION : latest
53+ TAGS : ${{ steps.meta.outputs.tags }}
54+
3655 run : ./ci/ci
Original file line number Diff line number Diff line change @@ -10,18 +10,16 @@ function print_green() {
1010set -euo pipefail
1111
1212PROJECT=${PROJECT:- }
13- VERSION =${VERSION :- latest }
13+ TAGS =${TAGS :- }
1414
1515print_green " \nBuilding devcontainer image for the ${PROJECT} project.\n"
1616
1717${PROJECT} /build
1818
1919echo " Build sucessful!"
2020
21- TAG=" ghcr.io/uw-midsun/devcontainers/${PROJECT} :${VERSION} "
21+ for tag in $TAGS ; do
22+ docker tag $PROJECT :latest $TAG
23+ docker push $TAG
24+ done
2225
23- print_green " \nTagging image as ${TAG} .\n"
24-
25- docker tag $PROJECT :latest $TAG
26-
27- docker push $TAG
You can’t perform that action at this time.
0 commit comments