Release to staging #56
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@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
cache: 'npm' | |
- uses: docker/setup-buildx-action@v2 | |
- name: Build image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./Dockerfile | |
build-args: | | |
E2E=true | |
push: false | |
load: true | |
tags: jami: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 | |
env: | |
CI: true | |
run: npm test | |
- name: Output application logs | |
run: docker-compose -f docker-compose.ci.yml logs -t --tail=100 | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build image | |
id: build-image | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: jami | |
tags: staging ${{ github.sha }} | |
containerfiles: | | |
./Dockerfile | |
build-args: | | |
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 }} |