forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (42 loc) · 1.33 KB
/
dev-db-nightly.yml
File metadata and controls
51 lines (42 loc) · 1.33 KB
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
# GITHUB ACTIONS - WORKFLOW
# Build the database dev docker image with the latest database dump every night
# so that developers don't have to manually build it themselves.
name: Nightly Dev DB Image
# Controls when the workflow will run
on:
# Run every night
schedule:
- cron: '0 0 * * *'
# Run on db.Dockerfile changes
push:
branches:
- main
paths:
- 'docker/db.Dockerfile'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: datatracker-db
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
permissions:
contents: read
packages: write
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Get Current Date as Tag
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d')"
- name: Docker Build & Push Action
uses: mr-smithers-excellent/docker-build-push@v5.6
with:
image: ${{ env.IMAGE_NAME }}
tags: nightly-${{ steps.date.outputs.date }}, latest
registry: ${{ env.REGISTRY }}
dockerfile: docker/db.Dockerfile
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}