-
Notifications
You must be signed in to change notification settings - Fork 378
63 lines (54 loc) · 1.56 KB
/
dev-assets-sync-nightly.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# GITHUB ACTIONS - WORKFLOW
# RSync the assets in the shared assets volume
name: Nightly Dev Shared Assets Sync
# Controls when the workflow will run
on:
# Run every night
schedule:
- cron: '0 1 * * *'
# Run on app-rsync-extras.sh changes
push:
branches:
- main
paths:
- 'docker/scripts/app-rsync-extras.sh'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
name: Build Docker Image
runs-on: ubuntu-latest
if: ${{ github.event_name != 'schedule' }}
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Build & Push
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_NO_SUMMARY: true
with:
context: .
file: dev/shared-assets-sync/Dockerfile
push: true
tags: ghcr.io/ietf-tools/datatracker-rsync-assets:latest
sync:
name: Run assets rsync
if: ${{ always() }}
runs-on: [self-hosted, dev-server]
needs: [build]
steps:
- name: Run rsync
env:
DEBIAN_FRONTEND: noninteractive
run: |
docker pull ghcr.io/ietf-tools/datatracker-rsync-assets:latest
docker run --rm -v dt-assets:/assets ghcr.io/ietf-tools/datatracker-rsync-assets:latest
docker image prune -a -f