Skip to content

Commit a1a9342

Browse files
committed
feat: pull development images from docker hub
* every 2 months to keep them active
1 parent e32a3ab commit a1a9342

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/pull-images.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Pull the Docker images from Docker Hub on schedule
2+
name: Pull Docker Images
3+
4+
on:
5+
schedule:
6+
# Runs "At 00:00 on day-of-month 1 in every 2nd month."
7+
- cron: '0 0 1 */2 *'
8+
9+
jobs:
10+
pull-images:
11+
name: Pull Development Images
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout the repository
15+
uses: actions/checkout@v3
16+
17+
- name: Fetch and check out latest tag
18+
run: |
19+
git fetch --tags
20+
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
21+
echo "Checking out latest tag: $LATEST_TAG"
22+
git checkout $LATEST_TAG
23+
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
24+
25+
- name: Pull Development Image
26+
run: docker compose -f docker-compose.dev.yml pull
27+
28+
- name: Pull Tagged Image
29+
run: |
30+
sed -i -e "s/latest/${{ env.LATEST_TAG }}/g" docker-compose.dev.yml
31+
docker compose -f docker-compose.dev.yml pull

0 commit comments

Comments
 (0)