ci: add multi-platform pg image build workflow steps
This commit is contained in:
parent
bc1cba1cca
commit
5a48d6a77d
87
.github/workflows/dev-db-pgtest.yml
vendored
87
.github/workflows/dev-db-pgtest.yml
vendored
|
@ -5,8 +5,8 @@ on:
|
|||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
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
|
||||
permissions:
|
||||
|
@ -32,32 +32,59 @@ jobs:
|
|||
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: Upload DB Dump
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: dump
|
||||
path: ietf.dump
|
||||
|
||||
build:
|
||||
name: Build PostgreSQL Docker Images
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
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 }}
|
||||
|
||||
|
||||
- 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: linux/amd64
|
||||
push: true
|
||||
tags: ghcr.io/ietf-tools/datatracker-db-pg:latest
|
||||
|
|
Loading…
Reference in a new issue