standard-build/.gitea/workflows/build-base-image.yaml

32 lines
1.0 KiB
YAML
Raw Normal View History

name: Build Docker Image for Actions
2023-08-28 18:22:32 +01:00
on: [push]
jobs:
Check-Last-Time:
runs-on: ubuntu-22.04
2023-08-28 18:06:04 +01:00
env:
DEBIAN_FRONTEND: noninteractive
2023-08-28 18:22:32 +01:00
outputs:
last-time: ${{ steps.last-time.outputs.last-time }}
steps:
2023-08-28 18:06:04 +01:00
- name: Install jq
run: |
apt-get update -y
apt-get install -y jq
- name: Check last repository build time
id: last-time
run: curl -s https://hub.docker.com/v2/repositories/drunkendog/standard-build-actions/tags/latest
| jq '.last_updated'
| xargs -i date --date {} +%s
2023-08-28 18:09:52 +01:00
| xargs -i expr $(date +%s) - {}
2023-08-28 18:22:32 +01:00
| xargs -i echo last-time={} >> $GITHUB_OUTPUT
Build-Image:
needs: [Check-Last-Time]
if: needs.Check-Last-Time.outputs.last-time > 1
runs-on: ubuntu-22.04
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Get Docker
run: curl -sL get.docker.io | bash
- name: Build and upload image
run: sh actions/build-docker-image.sh