Skip to content

Update dependency eslint to v9 #1616

Update dependency eslint to v9

Update dependency eslint to v9 #1616

Workflow file for this run

name: CI
on: pull_request
jobs:
CI:
runs-on: ubuntu-latest
environment: Dev
env:
KUBECONFIG: ${{ github.workspace }}/kubeconfig.yaml
DEV_VERSION_NAME: pr-${{ github.event.number }}
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- name: Setup Node.JS
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Download npm Dependencies
run: npm ci
- name: Build Dev Release
run: |
npm run clean
npm run build
- name: Log in to ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set Image Tag
id: imageTag
run: |
echo "IMAGE=ghcr.io/studierlangsam/webseite:$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_OUTPUT
- name: Build and Push Container
run: |
docker build . -t $IMAGE
docker push $IMAGE
env:
IMAGE: ${{ steps.imageTag.outputs.image }}
- name: Setup kubectl
uses: azure/setup-kubectl@v3.2
with:
version: v1.23.1
- name: Write Kubeconfig
run: |
echo "$KUBECONFIG_CONTENT" > "$KUBECONFIG"
env:
KUBECONFIG_CONTENT: ${{ secrets.DEPLOYMENT_KUBECONFIG }}
- name: Deploy to Dev
run: |
kubectl kustomize deployment/dev |
envsubst '$IMAGE $DEV_VERSION_NAME' |
kubectl apply -f - --prune --selector app=studierlangsam.de,version=$DEV_VERSION_NAME --prune-whitelist=apps/v1/Deployment --prune-whitelist=/v1/Service --prune-whitelist=networking.k8s.io/v1/Ingress
env:
IMAGE: ${{ steps.imageTag.outputs.image }}
- name: Delete Kubeconfig
if: always()
run: |
rm -f "$KUBECONFIG"
- name: Add Comment to PR
uses: mshick/add-pr-comment@v2
if: always()
with:
message: >
This Pull Request has been deployed to
[$DEV_VERSION_NAME.dev.studierlangsam.de](https://$DEV_VERSION_NAME.dev.studierlangsam.de).
You can preview it there :monocle_face:.
message-failure: >
Failed to deploy this PR because the pipeline failed :astonished:.
find: '\$DEV_VERSION_NAME'
replace: ${{ env.DEV_VERSION_NAME }}