Update dependency umzug to v3 #252
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Test (and release) Updater' | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- '.github/workflows/updater.yaml' | |
- 'updater/sis-updater-worker/**' | |
- 'updater/sis-updater-scheduler/**' | |
pull_request: | |
branches: | |
- master | |
paths: | |
- 'updater/sis-updater-worker/**' | |
- 'updater/sis-updater-scheduler/**' | |
jobs: | |
lint_scheduler_and_worker: | |
name: 'Lint scheduler and worker' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: 'Install dependencies' | |
run: npm ci && cd updater/sis-updater-scheduler && npm ci && cd ../sis-updater-worker && npm ci | |
- name: 'Run linter' | |
run: npm run eslint updater -- --report-unused-disable-directives | |
build_worker: | |
name: 'Build Updater worker' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-buildx-action@v3 | |
- name: 'Build the image' | |
uses: docker/build-push-action@v5 | |
with: | |
context: updater/sis-updater-worker/ | |
push: false | |
outputs: type=docker,dest=/tmp/worker.tar | |
tags: toska/sis-updater-worker:latest | |
- name: 'Store built image' | |
uses: actions/upload-artifact@v3 | |
with: | |
path: /tmp/worker.tar | |
build_scheduler: | |
name: 'Build Updater scheduler' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-buildx-action@v3 | |
- name: 'Build the image' | |
uses: docker/build-push-action@v5 | |
with: | |
context: updater/sis-updater-scheduler/ | |
push: false | |
outputs: type=docker,dest=/tmp/scheduler.tar | |
tags: toska/sis-updater-scheduler:latest | |
- name: 'Store built image' | |
uses: actions/upload-artifact@v3 | |
with: | |
path: /tmp/scheduler.tar | |
test_updater: | |
name: 'Test Updater' | |
runs-on: ubuntu-latest | |
needs: | |
- lint_scheduler_and_worker | |
- build_worker | |
- build_scheduler | |
steps: | |
- uses: actions/checkout@v4 | |
- name: 'Login to toska docker registry' | |
uses: docker/login-action@v3 | |
with: | |
registry: registry-toska.ext.ocp-prod-0.k8s.it.helsinki.fi | |
username: ${{ secrets.TOSKAREGISTRY_USERNAME }} | |
password: ${{ secrets.TOSKAREGISTRY_PASSWORD }} | |
- name: 'Download built images' | |
uses: actions/download-artifact@v3 | |
with: | |
path: /tmp/ | |
- name: 'Load worker image' | |
run: docker load --input /tmp/artifact/worker.tar | |
- name: 'Load scheduler image' | |
run: docker load --input /tmp/artifact/scheduler.tar | |
- name: 'Start worker' | |
run: docker compose --file docker-compose.ci.yml up --detach --no-recreate sis-updater-worker | |
- name: 'Run hourly jobs' | |
run: docker compose --file docker-compose.ci.yml run sis-updater-scheduler npm start | |
env: | |
SCHEDULE_IMMEDIATE: hourly | |
EXIT_AFTER_IMMEDIATES: yes | |
- name: 'Run weekly jobs' | |
run: docker compose --file docker-compose.ci.yml run sis-updater-scheduler npm start | |
env: | |
SCHEDULE_IMMEDIATE: weekly | |
EXIT_AFTER_IMMEDIATES: yes | |
- name: 'Run prepurge' | |
run: docker compose --file docker-compose.ci.yml run sis-updater-scheduler npm start | |
env: | |
SCHEDULE_IMMEDIATE: prepurge | |
EXIT_AFTER_IMMEDIATES: yes | |
- name: 'Run purge' | |
run: docker compose --file docker-compose.ci.yml run sis-updater-scheduler npm start | |
env: | |
SCHEDULE_IMMEDIATE: purge | |
EXIT_AFTER_IMMEDIATES: yes | |
release_worker: | |
name: 'Build and release Updater worker' | |
runs-on: ubuntu-latest | |
needs: test_updater | |
if: github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build worker image | |
id: build-image | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: updater-worker | |
tags: staging production ${{ github.sha }} | |
context: updater/sis-updater-worker | |
containerfiles: | | |
updater/sis-updater-worker/Dockerfile | |
- name: Push to quay.io | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build-image.outputs.image }} | |
tags: ${{ steps.build-image.outputs.tags }} | |
registry: quay.io/toska | |
username: toska+github | |
password: ${{ secrets.QUAY_IO_TOKEN }} | |
release_scheduler: | |
name: 'Build and release Updater scheduler' | |
runs-on: ubuntu-latest | |
needs: test_updater | |
if: github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build scheduler image | |
id: build-image | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: updater-scheduler | |
tags: staging production ${{ github.sha }} | |
context: updater/sis-updater-scheduler | |
containerfiles: | | |
updater/sis-updater-scheduler/Dockerfile | |
- name: Push to quay.io | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build-image.outputs.image }} | |
tags: ${{ steps.build-image.outputs.tags }} | |
registry: quay.io/toska | |
username: toska+github | |
password: ${{ secrets.QUAY_IO_TOKEN }} |