Update all non-major dependencies #314
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 | |
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@v6 | |
with: | |
context: updater/sis-updater-worker/ | |
push: false | |
outputs: type=docker,dest=/tmp/worker.tar | |
tags: toska/sis-updater-worker:latest | |
env: | |
DOCKER_BUILD_SUMMARY: false | |
- name: 'Upload image for other jobs' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: updater-worker-image | |
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@v6 | |
with: | |
context: updater/sis-updater-scheduler/ | |
push: false | |
outputs: type=docker,dest=/tmp/scheduler.tar | |
tags: toska/sis-updater-scheduler:latest | |
env: | |
DOCKER_BUILD_SUMMARY: false | |
- name: 'Upload image for other jobs' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: updater-scheduler-image | |
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@v4 | |
with: | |
pattern: 'updater-{worker,scheduler}-image' | |
merge-multiple: true | |
- name: 'Load worker image' | |
run: docker load --input worker.tar | |
- name: 'Load scheduler image' | |
run: docker load --input 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 | |
build-args: | | |
SENTRY_RELEASE=${{ github.sha }} | |
SENTRY_ENVIRONMENT=production | |
- 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 | |
build-args: | | |
SENTRY_RELEASE=${{ github.sha }} | |
SENTRY_ENVIRONMENT=production | |
- 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 }} |