ci: disable dev-db-nightly workflow

This commit is contained in:
Nicolas Giard 2023-04-12 20:53:37 -04:00 committed by GitHub
parent 48bb59aab7
commit 8f31ed8a54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 122 deletions

View file

@ -1,115 +0,0 @@
# GITHUB ACTIONS - WORKFLOW
name: Test DB Migration Build
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
exportDumpAsSQL:
description: 'Save PostgreSQL Debug Dump'
default: false
required: true
type: boolean
jobs:
migrate:
name: Migrate MySQL to PostgreSQL DB
runs-on: ubuntu-latest
container: ghcr.io/ietf-tools/datatracker-app-base:latest
permissions:
contents: read
packages: write
services:
db:
image: ghcr.io/ietf-tools/datatracker-db:latest
volumes:
- mariadb-data:/var/lib/mysql
env:
MYSQL_ROOT_PASSWORD: ietf
MYSQL_DATABASE: ietf_utf8
MYSQL_USER: django
MYSQL_PASSWORD: RkTkDPFnKpko
pgdb:
image: postgres:14.5
volumes:
- /pgdata:/var/lib/postgresql/data
env:
POSTGRES_PASSWORD: RkTkDPFnKpko
POSTGRES_USER: django
POSTGRES_DB: ietf
POSTGRES_HOST_AUTH_METHOD: trust
steps:
- uses: actions/checkout@v3
with:
ref: 'feat/pg-migrations'
- name: Migrate
uses: nick-fields/retry@v2
with:
timeout_minutes: 30
max_attempts: 3
command: |
chmod +x ./docker/scripts/db-pg-migrate.sh
sh ./docker/scripts/db-pg-migrate.sh
on_retry_command: |
psql -U django -h pgdb -d ietf -v ON_ERROR_STOP=1 -c '\x' -c 'DROP SCHEMA ietf_utf8 CASCADE;'
rm -f cast.load
- name: Upload DB Dump
uses: actions/upload-artifact@v3
with:
name: dump
path: ietf.dump
- name: Export as SQL (Debug)
if: ${{ github.event.inputs.exportDumpAsSQL == 'true' }}
run: pg_dump -h pgdb -U django ietf > ietf.sql
- name: Upload SQL DB Dump (Debug)
if: ${{ github.event.inputs.exportDumpAsSQL == 'true' }}
uses: actions/upload-artifact@v3
with:
name: dumpsql
path: ietf.sql
build:
name: Build PostgreSQL Docker Images
runs-on: ubuntu-latest
needs: [migrate]
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
with:
ref: 'feat/pg-migrations'
- name: Download DB Dump
uses: actions/download-artifact@v3
with:
name: dump
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Build & Push
uses: docker/build-push-action@v4
with:
context: .
file: docker/db-pg.Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/ietf-tools/datatracker-db-pg:migrate-test
provenance: false

View file

@ -11,15 +11,15 @@ name: Nightly Dev DB Image
# Controls when the workflow will run
on:
# Run every night
schedule:
- cron: '0 8 * * *'
# schedule:
# - cron: '0 8 * * *'
# Run on db.Dockerfile changes
push:
branches:
- main
paths:
- 'docker/db.Dockerfile'
# push:
# branches:
# - main
# paths:
# - 'docker/db.Dockerfile'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch: