Automate build of timelimit-server docker image
Build and push timelimit-server-ui image / check (push) Successful in 21s
Build and push timelimit-server-ui image / build (push) Has been skipped
Build and push timelimit-server image / check (push) Successful in 1s
Build and push timelimit-server image / build (push) Has been skipped
Build and push timelimit-server-ui image / check (push) Successful in 21s
Build and push timelimit-server-ui image / build (push) Has been skipped
Build and push timelimit-server image / check (push) Successful in 1s
Build and push timelimit-server image / build (push) Has been skipped
This commit is contained in:
@@ -2,7 +2,7 @@ name: Build and push timelimit-server-ui image
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 */3 * *" # every 72 hours
|
||||
- cron: "0 5 */3 * *" # every 72 hours
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
name: Build and push timelimit-server image
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "30 5 */3 * *" # every 72 hours
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
exists: ${{ steps.exists.outputs.exists }}
|
||||
sha: ${{ steps.sha.outputs.sha }}
|
||||
steps:
|
||||
# Get latest timelimit-server commit SHA
|
||||
- name: Get timelimit-server commit SHA
|
||||
id: sha
|
||||
run: |
|
||||
SHA=$(git ls-remote https://gitea.furb.it/${{ vars.SERVER_PATH }}.git refs/heads/${{ vars.SERVER_BRANCH }} | cut -f1)
|
||||
echo "sha=$SHA" >> $GITEA_OUTPUT
|
||||
|
||||
# Try to read timelimit-server SHA from latest image label
|
||||
- name: Check if image with timelimit-server SHA exists
|
||||
id: exists
|
||||
run: |
|
||||
SHA="${{ steps.sha.outputs.sha }}"
|
||||
|
||||
STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
|
||||
-u "${{ secrets.USERNAME }}:${{ secrets.ACCESS_TOKEN }}" \
|
||||
-H "Accept: application/vnd.docker.distribution.manifest.v2+json" \
|
||||
https://gitea.furb.it/v2/${{ vars.SERVER_IMAGE }}/manifests/$SHA)
|
||||
|
||||
if [ "$STATUS" = "200" ]; then
|
||||
echo "exists=true" >> $GITEA_OUTPUT
|
||||
else
|
||||
echo "exists=false" >> $GITEA_OUTPUT
|
||||
fi
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: check
|
||||
if: needs.check.outputs.exists == 'false'
|
||||
steps:
|
||||
|
||||
# Checkout timelimit-server repository for build
|
||||
- name: Checkout timelimit-server repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ vars.SERVER_PATH }}.git
|
||||
ref: ${{ needs.check.outputs.sha }}
|
||||
token: ${{ secrets.ACCESS_TOKEN }}
|
||||
|
||||
# Login to registry (needed to inspect latest image)
|
||||
- name: Docker login
|
||||
run: |
|
||||
echo "${{ secrets.ACCESS_TOKEN }}" | docker login gitea.furb.it \
|
||||
-u "${{ secrets.USERNAME }}" \
|
||||
--password-stdin
|
||||
|
||||
# Build image with commit-SHA tag and label
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
docker build \
|
||||
-f Dockerfile \
|
||||
--label timelimit-server.sha=${{ needs.check.outputs.sha }} \
|
||||
-t gitea.furb.it/${{ vars.SERVER_IMAGE }}:${{ needs.check.outputs.sha }} \
|
||||
-t gitea.furb.it/${{ vars.SERVER_IMAGE }}:latest \
|
||||
.
|
||||
|
||||
# Push images
|
||||
- name: Push Docker images
|
||||
run: |
|
||||
docker push gitea.furb.it/${{ vars.SERVER_IMAGE }}:${{ needs.check.outputs.sha }}
|
||||
docker push gitea.furb.it/${{ vars.SERVER_IMAGE }}:latest
|
||||
@@ -1,3 +1,21 @@
|
||||
# timelimit-docker
|
||||
|
||||
Build docker images from timelimit repositories.
|
||||
Build docker images from timelimit repositories.
|
||||
|
||||
## timelimit-server
|
||||
This repository does have a dockerfile.
|
||||
Using a workflow, the server repo is built, and packaged in an image.
|
||||
|
||||
| **Available tags** | |
|
||||
|--------------------|--------|
|
||||
| Latest version | latest |
|
||||
| Specific commit | <sha> |
|
||||
|
||||
## timelimit-server-ui
|
||||
This repository does not have a dockerfile. This repository contains a docker file.
|
||||
Using a workflow, the server-ui repo is built, and packaged in an image.
|
||||
|
||||
| **Available tags** | |
|
||||
|--------------------|--------|
|
||||
| Latest version | latest |
|
||||
| Specific commit | <sha> |
|
||||
Reference in New Issue
Block a user