diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92d0b4e..fe654e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,16 +3,16 @@ name: Build, Test, Deploy on: push: branches: - - 'master' - - 'main' + - "master" + - "main" tags: - - 'v*' + - "v*" pull_request: workflow_dispatch: permissions: contents: read - packages: write ## Github container registry + packages: write ## Github container registry # deployments: write ## Github Pages concurrency: ci-${{ github.ref }} @@ -22,24 +22,24 @@ jobs: strategy: fail-fast: true matrix: - os: [ ubuntu-latest ] #, windows-latest ] # windows takes ~3x longer, not worth the cost for larger projects + os: [ubuntu-latest] #, windows-latest ] # windows takes ~3x longer, not worth the cost for larger projects runs-on: ${{ matrix.os }} timeout-minutes: 5 steps: -# - name: Dump GitHub context - # env: - # GITHUB_CONTEXT: ${{ toJson(github) }} - # run: echo "$GITHUB_CONTEXT" + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" - name: Checkout 🛎️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python ⚙️ - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: "3.11" # keep in sync with pipfile + python-version: "3.11" # keep in sync with pipfile - name: Install dependencies ⚙️ run: | @@ -59,20 +59,21 @@ jobs: build-and-push-docker: needs: build-and-test - if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || - startsWith(github.ref, 'refs/tags/v') && github.event.base_ref == format('refs/heads/{0}', github.event.repository.default_branch) + if: + github.ref == 'refs/heads/{{ github.event.repository.default_branch }}' || + (startsWith(github.ref, 'refs/tags/v') && github.event.base_ref == 'refs/heads/{{ github.event.repository.default_branch }}') runs-on: ubuntu-latest timeout-minutes: 20 steps: - name: Checkout 🛎️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 # https://github.com/docker/metadata-action - name: Export Metadata for Docker 🖊️ id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: | modischfabrications/cutsolver @@ -83,24 +84,24 @@ jobs: # https://github.com/docker/setup-qemu-action - name: Set up QEMU ⚙ - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 # https://github.com/docker/setup-buildx-action - name: Set up Docker Buildx ⚙ id: buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Report Buildx platforms 🖊️ run: echo ${{ steps.buildx.outputs.platforms }} - name: Login to DH 👤 - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Login to GHCR 👤 - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -108,7 +109,7 @@ jobs: # https://github.com/docker/build-push-action - name: Build and push to DH & GHCR 📦 - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: . platforms: linux/amd64,linux/arm64,linux/arm/v7 @@ -119,7 +120,7 @@ jobs: cache-to: type=inline - name: Update DH description 🖊️ - uses: peter-evans/dockerhub-description@v3 + uses: peter-evans/dockerhub-description@v5 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }}