name: build-website on: push: branches: - main jobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Node 20 uses: actions/setup-node@v4 with: node-version: 20 - name: Install dependencies run: npm ci - name: Build Next.js run: npm run build - name: Install Docker CLI run: | apt-get update apt-get install -y docker.io - name: Log in to registry run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login code.harborsmith.co -u matt --password-stdin - name: Build and push image env: IMAGE: code.harborsmith.co/matt/website run: | docker build -f Dockerfile -t $IMAGE:${{ github.sha }} . docker push $IMAGE:${{ github.sha }} docker tag $IMAGE:${{ github.sha }} $IMAGE:latest docker push $IMAGE:latest - name: Upload artifact uses: actions/upload-artifact@v3 with: name: website-dist path: .next