Skip to content

Update typescript-eslint monorepo to v8 (major) #329

Update typescript-eslint monorepo to v8 (major)

Update typescript-eslint monorepo to v8 (major) #329

Workflow file for this run

name: ci
on:
push:
branches:
- main
- production
pull_request:
branches:
- main
- production
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Sanitize repository slug
uses: actions/github-script@v7
id: repository_slug
with:
result-encoding: string
script: return '${{ github.repository }}'.toLowerCase()
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: ghcr.io/${{ steps.repository_slug.outputs.result }}:${{ github.sha }}
# test:
# needs: build
# runs-on: ubuntu-latest
# steps:
# - name: Test
# run: echo TODO
publish:
# needs: test
needs: build
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/production' }}
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Tag Docker image with branch name
run: |
DOCKER_IMAGE=ghcr.io/${{ github.repository }}
DOCKER_IMAGE=${DOCKER_IMAGE,,}
TAG=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
docker pull $DOCKER_IMAGE:$GITHUB_SHA
docker tag $DOCKER_IMAGE:$GITHUB_SHA $DOCKER_IMAGE:$TAG
docker push $DOCKER_IMAGE:$TAG
# deploy:
# needs: publish
# runs-on: ubuntu-latest
# if: ${{ github.ref == 'refs/heads/production' }}
# steps:
# - name: Deploy to production server
# env:
# SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
# SSH_KNOWN_HOSTS: ${{ secrets.SSH_KNOWN_HOSTS }}
# SERVER_USER: ${{ secrets.SERVER_USER }}
# SERVER_HOST: ${{ secrets.SERVER_HOST }}
# run: |
# mkdir ~/.ssh
# echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
# chmod 600 ~/.ssh/id_ed25519
# echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
# chmod 644 ~/.ssh/known_hosts
# eval $(ssh-agent -s)
# ssh-add ~/.ssh/id_ed25519
# ssh $SERVER_USER@$SERVER_HOST "ns-flex-insights"