Skip to content

CI/CD

CI/CD #69

Workflow file for this run

name: CI/CD
on:
push:
branches:
- main
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 18
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
format:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 18
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Format
run: yarn format
deploy:
runs-on: ubuntu-latest
needs:
- lint
- format
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to Docker registry
uses: docker/login-action@v2
with:
registry: https://registry.toino.pt
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Setup .env
run: |
echo "GH_APP_ID=${{ secrets.GH_APP_ID }}" >> .env
echo "GH_APP_PRIVATE_KEY='${{ secrets.GH_APP_PRIVATE_KEY }}'" >> .env
echo "GH_INSTALLATION_ID=${{ secrets.GH_INSTALLATION_ID }}" >> .env
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: registry.toino.pt/commits:latest
target: prod