Bump actions/setup-node from 4 to 5 #10
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Rust build | |
| on: | |
| push: | |
| pull_request: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| project: ["api", "cli", "generator"] | |
| defaults: | |
| run: | |
| working-directory: ${{ matrix.project }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: pnpm/action-setup@v4 | |
| if: matrix.project == 'cli' | |
| with: | |
| package_json_file: ${{ matrix.project }}/package.json | |
| run_install: true | |
| - name: Install Node.js | |
| uses: actions/setup-node@v5 | |
| if: matrix.project == 'cli' | |
| with: | |
| node-version: 24 | |
| cache: "pnpm" | |
| cache-dependency-path: "${{ matrix.project }}/pnpm-lock.yaml" | |
| - name: Build | |
| run: cargo build --verbose --release | |
| - name: Run tests | |
| run: cargo test --verbose | |
| - name: Run clippy | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: matrix.project == 'cli' | |
| with: | |
| name: cli-artifacts | |
| path: target/release/ | |
| demo: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| defaults: | |
| run: | |
| working-directory: example | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Download CLI artifacts | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: cli-artifacts | |
| path: example/cli | |
| - name: Make CLI executable | |
| run: chmod +x cli/luna_cli | |
| - name: Build index.json | |
| run: | | |
| ./cli/luna_cli generate | |
| - name: Build docs | |
| run: | | |
| ./cli/luna_cli docs | |
| - name: Deploy to SFTP | |
| if: github.ref == 'refs/heads/develop' | |
| env: | |
| SFTP_HOST: ${{ secrets.SFTP_HOST }} | |
| SFTP_USERNAME: ${{ secrets.SFTP_USERNAME }} | |
| SFTP_KEY: ${{ secrets.SFTP_KEY }} | |
| SFTP_KNOWN_HOSTS: ${{secrets.SFTP_KNOWN_HOSTS}} | |
| run: | | |
| echo "$SFTP_KEY" > sftp_key | |
| chmod 600 sftp_key | |
| echo "$SFTP_KNOWN_HOSTS" > known_hosts | |
| chmod 600 known_hosts | |
| rsync -avz --delete -e "ssh -i sftp_key -o UserKnownHostsFile=known_hosts" output/docs/ $SFTP_USERNAME@$SFTP_HOST:/var/www/demo.luna.linwood | |
| build-docker: | |
| runs-on: ubuntu-24.04 | |
| if: github.event_name != 'pull_request' | |
| steps: | |
| - name: ⬆️ Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set Docker tag | |
| id: docker_tag | |
| run: | | |
| if [[ "${GITHUB_REF}" == "refs/heads/main" ]]; then | |
| echo "tag=latest" >> $GITHUB_ENV | |
| elif [[ "${GITHUB_REF}" == "refs/heads/develop" ]]; then | |
| echo "tag=dev" >> $GITHUB_ENV | |
| elif [[ "${GITHUB_REF}" == refs/tags/v* || "${GITHUB_REF}" == "refs/tags/stable" || "${GITHUB_REF}" == "refs/tags/nightly" ]]; then | |
| echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
| else | |
| echo "tag=unknown" >> $GITHUB_ENV | |
| fi | |
| - name: Log Docker tag | |
| run: echo "Docker tag is ${{ env.tag }}" | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| if: ${{ env.tag != 'unknown' }} | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: linwooddev/luna:${{ env.tag }} |