versioned updates, init cleaned up

This commit is contained in:
aptalca
2022-02-11 13:30:05 -05:00
parent 2e3e95e194
commit eab09ae1b3
4 changed files with 65 additions and 29 deletions
+15 -4
View File
@@ -3,9 +3,9 @@ name: Build Image
on: [push, pull_request, workflow_dispatch]
env:
ENDPOINT: "linuxserver/mods" #don't modify
BASEIMAGE: "code-server" #replace
MODNAME: "julia" #replace
ENDPOINT: "linuxserver/mods"
BASEIMAGE: "code-server"
MODNAME: "julia"
jobs:
build:
@@ -15,14 +15,21 @@ jobs:
- name: Build image
run: |
docker build --no-cache -t ${{ github.sha }} .
# Set version
JULIA_VERSION=$(curl -sfX GET "https://api.github.com/repos/JuliaLang/julia/releases/latest" | jq -r '. | .tag_name' | sed 's|^v||')
echo "JULIA_VERSION=${JULIA_VERSION}" >> $GITHUB_ENV
docker build --no-cache --build-arg JULIA_VERSION="${JULIA_VERSION}" -t ${{ github.sha }} .
- name: Tag image
if: ${{ github.ref == format('refs/heads/{0}-{1}', env.BASEIMAGE, env.MODNAME) }}
run: |
docker tag ${{ github.sha }} ${ENDPOINT}:${BASEIMAGE}-${MODNAME}
docker tag ${{ github.sha }} ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ env.JULIA_VERSION }}
docker tag ${{ github.sha }} ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ env.JULIA_VERSION }}-${{ github.sha }}
docker tag ${{ github.sha }} ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ github.sha }}
docker tag ${{ github.sha }} ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}
docker tag ${{ github.sha }} ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ env.JULIA_VERSION }}
docker tag ${{ github.sha }} ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ env.JULIA_VERSION }}-${{ github.sha }}
docker tag ${{ github.sha }} ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ github.sha }}
- name: Credential check
@@ -47,6 +54,8 @@ jobs:
- name: Push tags to GitHub Container Registry
if: ${{ github.ref == format('refs/heads/{0}-{1}', env.BASEIMAGE, env.MODNAME) && env.CR_USER && env.CR_PAT }}
run: |
docker push ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ env.JULIA_VERSION }}
docker push ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ env.JULIA_VERSION }}-${{ github.sha }}
docker push ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ github.sha }}
docker push ghcr.io/${ENDPOINT}:${BASEIMAGE}-${MODNAME}
@@ -58,5 +67,7 @@ jobs:
- name: Push tags to DockerHub
if: ${{ github.ref == format('refs/heads/{0}-{1}', env.BASEIMAGE, env.MODNAME) && env.DOCKERUSER && env.DOCKERPASS }}
run: |
docker push ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ env.JULIA_VERSION }}
docker push ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ env.JULIA_VERSION }}-${{ github.sha }}
docker push ${ENDPOINT}:${BASEIMAGE}-${MODNAME}-${{ github.sha }}
docker push ${ENDPOINT}:${BASEIMAGE}-${MODNAME}