-
Notifications
You must be signed in to change notification settings - Fork 7
36 lines (30 loc) · 1.04 KB
/
pull-images.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# 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 App 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: Create temporary env variables
run: |
cp client/.env.example client/.env
cp server/.env.example server/.env
- name: Pull App Image
run: |
sed -i "s/:latest/:$LATEST_TAG/" docker-compose.app.yml
docker compose -f docker-compose.app.yml pull
- name: Pull Development Images
run: docker compose -f docker-compose.dev.yml pull