1196 add dose to medium and let to medium #2271
Workflow file for this run
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: Node.js CI | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
# see https://github.community/t/treating-warnings-as-errors-because-process-env-ci-true/18032 | |
env: | |
CI: false | |
jobs: | |
build_and_test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- run: npm ci | |
- run: npm run build --if-present | |
- run: npm run start & | |
- name: Wait for the app to start | |
uses: iFaxity/[email protected] | |
with: | |
resource: http://localhost:3000 | |
- name: Run tests | |
uses: nick-fields/retry@v2 | |
with: | |
max_attempts: 2 | |
retry_on: error | |
timeout_seconds: 240 | |
command: npm test | |
deploy-to-github-registry: | |
needs: [build_and_test] | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }}-web | |
# when we run this action as depenabot, we need to give it write permissions to the package registry and to the statuses | |
permissions: | |
contents: read | |
packages: write | |
statuses: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/[email protected] | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
# see https://github.com/docker/build-push-action/issues/513#issuecomment-987951050 | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
# it seems that cache is not giving any benefit in speed, lets keep it disabled for now | |
# cache-from: type=gha | |
# cache-to: type=gha,mode=max | |
build-args: | | |
BUILDKIT_CONTEXT_KEEP_GIT_DIR=true | |
DEPLOYMENT=dev | |
deploy_gh_pages: | |
runs-on: ubuntu-latest | |
needs: [build_and_test] | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install 🔧 | |
run: npm install | |
- name: Use Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
cache: 'npm' | |
- name: webfactory/ssh-agent 🖥️ | |
uses: webfactory/[email protected] | |
with: | |
# Private SSH key to register in the SSH agent | |
ssh-private-key: ${{ secrets.WEBDEV }} | |
- name: Deploy 🚀 | |
run: | | |
git remote set-url origin [email protected]:yaptide/web_dev.git | |
npm run deploy -- -u "github-actions-bot <[email protected]>" -r "[email protected]:yaptide/web_dev.git" |