Skip to content

Commit 2927d09

Browse files
committed
Add docker publish action
1 parent a9ed854 commit 2927d09

File tree

3 files changed

+37
-76
lines changed

3 files changed

+37
-76
lines changed

.github/workflows/ci.yaml

-75
This file was deleted.

.github/workflows/publish.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Push to GH container Repo
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
env:
8+
IMAGE_NAME: GradescopeCDHelper
9+
10+
jobs:
11+
push:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
packages: write
15+
contents: read
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Build image
20+
run: docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"
21+
22+
- name: Log in to registry
23+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
24+
25+
- name: Push image
26+
run: |
27+
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
28+
29+
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
30+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
31+
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
32+
[ "$VERSION" == "main" ] && VERSION=latest
33+
echo IMAGE_ID=$IMAGE_ID
34+
echo VERSION=$VERSION
35+
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
36+
docker push $IMAGE_ID:$VERSION

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gradescope-cd-helper-action",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "A GitHub Action to help with the automated deployment of gradescope autograders",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)