Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
taukakao committed Jan 29, 2024
1 parent 54f532f commit b8ca5a0
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/check_image_update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
curl https://differ.vanillaos.org/images/desktop > /tmp/vanilla-image-info
imagetimejson="$(jq -r '.image.releases[-1].date' /tmp/vanilla-image-info)"
imagetime="$(date -u -d $imagetimejson +%s)"
currenttime="$(date -u +%s)"
imageage="$(($currenttime - $imagetime))"
echo Latest image is "$imageage" seconds old
if [ $imageage -le 86400 ]
then
echo "Image is younger than a day"
exit 0
else
echo "Image is older than a day"
exit 1
fi
63 changes: 63 additions & 0 deletions .github/workflows/vib-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Vib Build

on:
push:
branches: [ "main" ]
schedule:
- cron: '22 0 * * *'
workflow_dispatch:

env:
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}

jobs:
check_update:
runs-on: ubuntu-latest
if: github.event_name == 'schedule'
steps:
- uses: actions/checkout@v4

- name: Check if there was an update to the base image
run: |
bash ${GITHUB_WORKSPACE}/.github/workflows/check_image_update.sh
echo "::set-output name=exitcode::$?"
hello_world:
runs-on: ubuntu-latest
needs: check_update
if: needs.check_update.outputs.exitcode == 0
steps:
- name: Hello World
run: echo "Hello, world"

bye_world:
runs-on: ubuntu-latest
needs: check_update
if: needs.check_update.outputs.exitcode != 0
steps:
- name: Bye World
run: echo "Bye, world"


# build:
#
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v4
#
# - uses: vanilla-os/[email protected]
# with:
# recipe: 'recipe.yml'
# plugins: 'Vanilla-OS/vib-fsguard:v1.2-1'
#
# - name: Build the Docker image
# run: docker image build -f Containerfile --tag ghcr.io/vanilla-os/desktop:main .
#
# # Push the image to GHCR (Image Registry)
# - name: Push To GHCR
# if: github.repository == 'vanilla-os/desktop-image'
# run: |
# docker login ghcr.io -u ${{ env.REGISTRY_USER }} -p ${{ env.REGISTRY_PASSWORD }}
# docker image push "ghcr.io/vanilla-os/desktop:main"

0 comments on commit b8ca5a0

Please sign in to comment.