From dddaebd0f38cdfe9ce231dabebb77ff6d0f48dec Mon Sep 17 00:00:00 2001 From: nick Date: Tue, 7 Dec 2021 03:19:26 +0000 Subject: [PATCH] build: Add GitHub Actions workflow for automatic nightly datatracker DB image build Commit ready for merge. - Legacy-Id: 19750 --- .editorconfig | 23 +++++++++++++++ .github/workflows/dev-db-nightly.yml | 43 ++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 .github/workflows/dev-db-nightly.yml diff --git a/.editorconfig b/.editorconfig index 63bf7a66d..afba95f39 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,6 +5,7 @@ root = true # Settings for IETF datatracker +# --------------------------------------------------------- [*] indent_style = space @@ -14,3 +15,25 @@ charset = utf-8 # to avoid tripping Henrik's commit hook: trim_trailing_whitespace = false insert_final_newline = false + +# Settings for .github folder +# --------------------------------------------------------- + +[.github/**] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = false +insert_final_newline = true + +# Settings for client-side JS / Vue files +# --------------------------------------------------------- + +[client/**] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/.github/workflows/dev-db-nightly.yml b/.github/workflows/dev-db-nightly.yml new file mode 100644 index 000000000..c620fd7b3 --- /dev/null +++ b/.github/workflows/dev-db-nightly.yml @@ -0,0 +1,43 @@ +# 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: + schedule: + - cron: '0 0 * * *' + + # 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 }}