docs: update local development docs #94
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: Release to staging | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'npm' | |
- uses: docker/setup-buildx-action@v3 | |
- name: Build image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: false | |
load: true | |
tags: norppa-updater:latest | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Start the application | |
run: docker-compose -f docker-compose.ci.yml up -d | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: echo "Waiting 6 seconds before starting..." && sleep 6 && npm test | |
- name: Output application logs on failure | |
if: failure() | |
run: docker-compose -f docker-compose.ci.yml logs -t --tail=100 | |
build-and-push: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build image | |
id: build-image | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: norppa-updater | |
tags: staging ${{ github.sha }} | |
containerfiles: | | |
./Dockerfile | |
build-args: | | |
BASE_PATH=/ | |
NODE_ENV=staging | |
- 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 }} |