From 3e9a2c0272f18528ecc0bc9164f6d300faed989b Mon Sep 17 00:00:00 2001 From: weaponsforge Date: Fri, 4 Oct 2024 05:14:23 +0800 Subject: [PATCH] feat: pull development images every 2 months * to keep them active in the free docker hub account --- .github/workflows/pull-images.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/pull-images.yml diff --git a/.github/workflows/pull-images.yml b/.github/workflows/pull-images.yml new file mode 100644 index 0000000..3b009a4 --- /dev/null +++ b/.github/workflows/pull-images.yml @@ -0,0 +1,26 @@ +# Pull the Docker images from Docker Hub on schedule +name: Pull Docker Images + +on: + schedule: + # Runs "At 00:00 on day-of-month 1 in every 2nd month." + - cron: '0 0 1 */2 *' + +jobs: + pull-images: + name: Pull Development Image + runs-on: ubuntu-latest + steps: + - name: Checkout the repository + uses: actions/checkout@v3 + + - name: Fetch and check out latest tag + run: | + git fetch --tags + LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) + echo "Checking out latest tag: $LATEST_TAG" + git checkout $LATEST_TAG + echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV + + - name: Pull Development Image + run: docker compose -f docker-compose.dev.yml pull