ci: move pg build to nightly db workflow
This commit is contained in:
parent
eac5ec0d67
commit
ce9afdcc90
121
.github/workflows/dev-db-nightly.yml
vendored
121
.github/workflows/dev-db-nightly.yml
vendored
|
@ -91,21 +91,14 @@ jobs:
|
|||
docker manifest push -p ghcr.io/ietf-tools/datatracker-db:nightly-${{ steps.date.outputs.date }}
|
||||
docker manifest push -p ghcr.io/ietf-tools/datatracker-db:latest
|
||||
|
||||
build-pg:
|
||||
name: Build PostgreSQL Docker Images
|
||||
migrate:
|
||||
name: Migrate MySQL to PostgreSQL DB
|
||||
runs-on: ubuntu-latest
|
||||
container: ghcr.io/ietf-tools/datatracker-app-base:latest
|
||||
needs: [combine-mariadb]
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- platform: "linux/arm64"
|
||||
docker: "arm64"
|
||||
- platform: "linux/amd64"
|
||||
docker: "x64"
|
||||
services:
|
||||
db:
|
||||
image: ghcr.io/ietf-tools/datatracker-db:latest
|
||||
|
@ -116,61 +109,71 @@ jobs:
|
|||
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/postgres'
|
||||
|
||||
- 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 }}
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: 'feat/postgres'
|
||||
|
||||
- name: Migrate
|
||||
run: |
|
||||
chmod +x ./docker/scripts/db-pg-migrate.sh
|
||||
sh ./docker/scripts/db-pg-migrate.sh
|
||||
|
||||
- name: Docker Build & Push
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
file: docker/db-pg.Dockerfile
|
||||
platforms: ${{ matrix.platform }}
|
||||
push: true
|
||||
tags: ghcr.io/ietf-tools/datatracker-db-pg:latest-${{ matrix.docker }}
|
||||
|
||||
combine-pg:
|
||||
name: Create PostgreSQL Docker Manifests
|
||||
- name: Migrate
|
||||
run: |
|
||||
chmod +x ./docker/scripts/db-pg-migrate.sh
|
||||
sh ./docker/scripts/db-pg-migrate.sh
|
||||
|
||||
- name: Upload DB Dump
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: dump
|
||||
path: ietf.dump
|
||||
|
||||
build:
|
||||
name: Build PostgreSQL Docker Images
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build-pg]
|
||||
needs: [migrate]
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Get Current Date as Tag
|
||||
id: date
|
||||
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: 'feat/postgres'
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Download DB Dump
|
||||
uses: actions/download-artifact@v3.0.0
|
||||
with:
|
||||
name: dump
|
||||
|
||||
- name: Create and Push Manifests
|
||||
run: |
|
||||
echo "Creating the manifests..."
|
||||
docker manifest create ghcr.io/ietf-tools/datatracker-db-pg:nightly-${{ steps.date.outputs.date }} ghcr.io/ietf-tools/datatracker-db-pg:latest-x64 ghcr.io/ietf-tools/datatracker-db-pg:latest-arm64
|
||||
docker manifest create ghcr.io/ietf-tools/datatracker-db-pg:latest ghcr.io/ietf-tools/datatracker-db-pg:latest-x64 ghcr.io/ietf-tools/datatracker-db-pg:latest-arm64
|
||||
echo "Pushing the manifests..."
|
||||
docker manifest push -p ghcr.io/ietf-tools/datatracker-db-pg:nightly-${{ steps.date.outputs.date }}
|
||||
docker manifest push -p ghcr.io/ietf-tools/datatracker-db-pg:latest
|
||||
- name: Get Current Date as Tag
|
||||
id: date
|
||||
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
|
||||
|
||||
- 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@v3
|
||||
with:
|
||||
context: .
|
||||
file: docker/db-pg.Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ghcr.io/ietf-tools/datatracker-db-pg:latest,ghcr.io/ietf-tools/datatracker-db-pg:nightly-${{ steps.date.outputs.date }}
|
||||
|
|
94
.github/workflows/dev-db-pgtest.yml
vendored
94
.github/workflows/dev-db-pgtest.yml
vendored
|
@ -1,94 +0,0 @@
|
|||
name: Dev PG DB Test
|
||||
|
||||
on:
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
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/postgres'
|
||||
|
||||
- name: Migrate
|
||||
run: |
|
||||
chmod +x ./docker/scripts/db-pg-migrate.sh
|
||||
sh ./docker/scripts/db-pg-migrate.sh
|
||||
|
||||
- name: Upload DB Dump
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: dump
|
||||
path: ietf.dump
|
||||
|
||||
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/postgres'
|
||||
|
||||
- name: Download DB Dump
|
||||
uses: actions/download-artifact@v3.0.0
|
||||
with:
|
||||
name: dump
|
||||
|
||||
- name: Get Current Date as Tag
|
||||
id: date
|
||||
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
|
||||
|
||||
- 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@v3
|
||||
with:
|
||||
context: .
|
||||
file: docker/db-pg.Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ghcr.io/ietf-tools/datatracker-db-pg:latest,ghcr.io/ietf-tools/datatracker-db-pg:nightly-${{ steps.date.outputs.date }}
|
||||
|
||||
|
Loading…
Reference in a new issue