Skip to content

Commit

Permalink
Merge pull request #1643 from serlo/deploy-migration-link-course
Browse files Browse the repository at this point in the history
db migration deployment: set to old way and make ci
  • Loading branch information
hugotiburtino authored Jul 2, 2024
2 parents 9885162 + 96f0c8c commit ce71573
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
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

0 comments on commit ce71573

Please sign in to comment.