Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db migration deployment: set to old way and make ci #1643

Merged
merged 5 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/push-migration-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Push DB migration image
on:
# not a problem if we do it at every push because it will check if the image already exists
push:

jobs:
docker-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: serlo/configure-repositories/actions/setup-node@main
- uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_KEY_CONTAINER_REGISTRY }}'
- run: gcloud auth configure-docker
- uses: google-github-actions/setup-gcloud@v2
- run: yarn migrate:push-image
2 changes: 2 additions & 0 deletions packages/db-migrations/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ RUN yarn plugin import workspace-tools
RUN yarn workspaces focus --production
COPY --from=build_migrations /app/migrations migrations
COPY migrations/package.json migrations/package.json
COPY database.json .

ENTRYPOINT ["yarn", "db-migrate"]
CMD ["up"]
2 changes: 1 addition & 1 deletion packages/db-migrations/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@serlo/db-migrations",
"version": "1.0.0",
"version": "1.1.0-staging.2",
"private": true,
"license": "Apache-2.0",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/db-migrations/scripts/push-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void run()
async function run() {
const { version } = await fetchPackageJSON()
buildDockerImage({
name: 'db-migration',
name: 'api-db-migration',
version,
Dockerfile: path.join(root, 'Dockerfile'),
context: '.',
Expand Down