diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 231a780..cdfba5c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,9 @@ name: CI + on: push: - branches: - - main + pull_request: jobs: build: @@ -35,27 +35,33 @@ jobs: - name: Install Netlify CLI run: npm install -g netlify-cli + - name: Deploy to Netlify + if: github.ref == 'refs/heads/main' run: netlify deploy --prod --dir=./site/.vitepress/dist env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} + - name: Push to dokku + if: github.ref == 'refs/heads/main' uses: dokku/github-action@master with: git_remote_url: "ssh://dokku@51.15.42.142:22/verify" ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} git_push_flags: '--force' + - name: Build image - run: docker build -t scimverify-test . + run: docker build -t scimverify-test . + - name: Authenticate to GHCR + if: github.ref == 'refs/heads/main' run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin + - name: Push image + if: github.ref == 'refs/heads/main' run: docker push ghcr.io/${{ github.repository }}:latest - - - name: Test Docker image - run: bash ./test-docker.sh diff --git a/test-docker.sh b/test-docker.sh deleted file mode 100644 index 27d38b5..0000000 --- a/test-docker.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -e - -echo "Building Docker image..." -docker build -t scimverify-test . - -echo "Running tests in Docker container..." -docker run --rm scimverify-test npm test