From 88b98298604c271561638614e40a1818d27b8589 Mon Sep 17 00:00:00 2001 From: Ryan Lelek Date: Mon, 29 Apr 2024 17:35:15 -0500 Subject: [PATCH] Edit: GitHub Actions CI --- .github/workflows/README.md | 3 +++ .github/workflows/docker-image.yml | 22 ++++++++++++--------- .github/workflows/docker-release.yml | 19 +++++++++++++----- .github/workflows/node.js.yml | 29 +++++++++++++++++----------- 4 files changed, 48 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/README.md diff --git a/.github/workflows/README.md b/.github/workflows/README.md new file mode 100644 index 00000000..9f24f87f --- /dev/null +++ b/.github/workflows/README.md @@ -0,0 +1,3 @@ +# GitHub Actions +Documentation and search here +https://github.com/marketplace?type=actions diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index b0b1f930..c8cb6e95 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,34 +1,38 @@ --- -# https://github.com/marketplace/actions/build-and-push-docker-images # https://docs.github.com/en/actions/publishing-packages/publishing-docker-images -# https://github.com/docker/login-action name: Docker Image CI - on: push: branches: ["main"] jobs: - build: runs-on: ubuntu-latest environment: Docker steps: - # - uses: actions/checkout@v3 - # name: Build the Docker image - # run: docker build . --file Dockerfile --tag raento/raneto:latest-$(date +%s) + # https://github.com/marketplace/actions/checkout + # - name: Build the Docker image + # uses: actions/checkout@v4 + # run: docker build . --file Dockerfile --tag raneto/raneto:latest-$(date +%s) + + # https://github.com/marketplace/actions/docker-setup-buildx + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + # https://github.com/marketplace/actions/docker-login + # https://github.com/docker/login-action - name: Login to Docker Hub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} + # https://github.com/marketplace/actions/build-and-push-docker-images - name: Build and push - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: #context: . push: true diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index 71420ad5..5edf6cb2 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -2,7 +2,6 @@ # https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/ name: Docker Release - on: workflow_dispatch: inputs: @@ -12,23 +11,33 @@ on: default: 'latest' jobs: - build: runs-on: ubuntu-latest environment: Docker steps: + # https://github.com/marketplace/actions/checkout + # - name: Build the Docker image + # uses: actions/checkout@v4 + # run: docker build . --file Dockerfile --tag raneto/raneto:latest-$(date +%s) + + # https://github.com/marketplace/actions/docker-setup-buildx + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + # https://github.com/marketplace/actions/docker-login + # https://github.com/docker/login-action - name: Login to Docker Hub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }} + # https://github.com/marketplace/actions/build-and-push-docker-images - name: Build and push - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: #context: . push: true - tags: "raneto/raneto:${{ github.event.inputs.version }}" + tags: "raneto/raneto:${{ github.event.inputs.version }}" \ No newline at end of file diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 4a89961e..29a50b08 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -3,7 +3,6 @@ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs name: Node.js CI - on: push: branches: ["main"] @@ -13,22 +12,30 @@ on: jobs: build: - # List - # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories - runs-on: ubuntu-latest - strategy: matrix: - node-version: [20.x, 22.x] + # Windows is currently borked + # https://github.com/nodejs/node/issues/52682 + # Disabling for now + # windows-latest + os: [ubuntu-latest] + node_version: [20.x, 22.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + # OS List + # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + # https://github.com/marketplace/actions/checkout + - uses: actions/checkout@v4 + # https://github.com/marketplace/actions/setup-node-js-environment + - name: Use Node.js ${{ matrix.node_version }} + uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} - cache: 'npm' + node-version: ${{ matrix.node_version }} + #cache: 'npm' - run: npm ci # - run: npm run build --if-present - run: npm test + - run: npm run lint + - run: npm run prettier