Skip to content

Commit 75c7450

Browse files
committed
Actually do the thing
1 parent 0ca6805 commit 75c7450

3 files changed

Lines changed: 28 additions & 11 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
name: Deploy
22

3-
on:
4-
push:
5-
# branches: [main]
3+
push:
4+
branches:
5+
- "main"
6+
tags:
7+
- "v*.*.*"
8+
69
permissions:
710
packages: write
811

@@ -18,6 +21,21 @@ jobs:
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:
@@ -32,5 +50,6 @@ jobs:
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

ci/.ci.swp

12 KB
Binary file not shown.

ci/ci

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,16 @@ function print_green() {
1010
set -euo pipefail
1111

1212
PROJECT=${PROJECT:-}
13-
VERSION=${VERSION:-latest}
13+
TAGS=${TAGS:-}
1414

1515
print_green "\nBuilding devcontainer image for the ${PROJECT} project.\n"
1616

1717
${PROJECT}/build
1818

1919
echo "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

0 commit comments

Comments
 (0)