diff options
| author | 2022-11-05 20:27:50 +0000 | |
|---|---|---|
| committer | 2022-11-05 20:27:50 +0000 | |
| commit | ffd073ac5192584cdd4ff5a278aa1222563fcbdb (patch) | |
| tree | 46805f382a33ba310adfbcd68c93f0f42509551f | |
| parent | Merge pull request #155 from onerandomusername/github-deprecations (diff) | |
| parent | remove the unnecessary and possibly invalid kubectl version request to azure/... (diff) | |
Merge pull request #156 from onerandomusername/update-actions-checkout
upgrade all gha packages to their latest node16 versions
| -rw-r--r-- | .github/workflows/build.yaml | 12 | ||||
| -rw-r--r-- | .github/workflows/deploy.yaml | 24 | ||||
| -rw-r--r-- | .github/workflows/lint.yaml | 6 | ||||
| -rw-r--r-- | .github/workflows/sentry_release.yaml | 2 | ||||
| -rw-r--r-- | .github/workflows/test.yaml | 10 | 
5 files changed, 29 insertions, 25 deletions
| diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index eb53e5a..d98d32f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -20,7 +20,7 @@ jobs:      steps:        - name: Checkout code -        uses: actions/checkout@v2 +        uses: actions/checkout@v3          with:            # The version script relies on history. Fetch 100 commits to be safe.            fetch-depth: 100 @@ -33,14 +33,14 @@ jobs:            echo "version=$version" >> $GITHUB_OUTPUT            printf "%s\n" "${version}" -      # The current version (v2) of Docker's build-push action uses buildx, +      # Both version 2 and 3 of Docker's build-push action uses buildx,        # which comes with BuildKit. It has cache features which can speed up        # the builds. See https://github.com/docker/build-push-action        - name: Set up Docker Buildx -        uses: docker/setup-buildx-action@v1 +        uses: docker/setup-buildx-action@v2        - name: Log in to GitHub Container Registry -        uses: docker/login-action@v1 +        uses: docker/login-action@v2          with:            registry: ghcr.io            username: ${{ github.repository_owner }} @@ -74,7 +74,7 @@ jobs:        # If configured by the cache_config step, also cache the layers in        # GitHub Actions.        - name: Build image for linting and testing -        uses: docker/build-push-action@v2 +        uses: docker/build-push-action@v3          with:            context: .            file: ./Dockerfile @@ -92,7 +92,7 @@ jobs:        # Make the image available as an artifact so other jobs will be able to        # download it.        - name: Upload image archive as an artifact -        uses: actions/upload-artifact@v2 +        uses: actions/upload-artifact@v3          with:            name: ${{ env.artifact }}            path: ${{ env.artifact }}.tar diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 82903f8..d8ad66b 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -18,7 +18,7 @@ jobs:      steps:        - name: Download image artifact -        uses: actions/download-artifact@v2 +        uses: actions/download-artifact@v3          with:            name: ${{ inputs.artifact }} @@ -27,17 +27,17 @@ jobs:          run: docker load -i ${{ inputs.artifact }}.tar        - name: Set up Docker Buildx -        uses: docker/setup-buildx-action@v1 +        uses: docker/setup-buildx-action@v2        - name: Log in to GitHub Container Registry -        uses: docker/login-action@v1 +        uses: docker/login-action@v2          with:            registry: ghcr.io            username: ${{ github.repository_owner }}            password: ${{ secrets.GITHUB_TOKEN  }}        - name: Checkout code -        uses: actions/checkout@v2 +        uses: actions/checkout@v3          with:            # The version script relies on history. Fetch 100 commits to be safe.            fetch-depth: 100 @@ -45,7 +45,7 @@ jobs:        # Build the final production image and push it to GHCR.        # Tag it with both the short commit SHA and 'latest'.        - name: Build final image -        uses: docker/build-push-action@v2 +        uses: docker/build-push-action@v3          with:            context: .            file: ./Dockerfile @@ -60,22 +60,26 @@ jobs:              ghcr.io/python-discord/snekbox:${{ inputs.version }}        # Deploy to Kubernetes. +      - name: Install kubectl +        uses: azure/[email protected] +        with: +          version: "latest" +        - name: Authenticate with Kubernetes -        uses: azure/k8s-set-context@v1 +        uses: azure/k8s-set-context@v3          with:            method: kubeconfig            kubeconfig: ${{ secrets.KUBECONFIG }}        - name: Deploy to Kubernetes -        uses: Azure/k8s-deploy@v1 +        uses: azure/k8s-deploy@v4          with:            manifests: deployment.yaml            images: 'ghcr.io/python-discord/snekbox:${{ inputs.version }}' -          kubectl-version: 'latest'        # Push the base image to GHCR, with an inline cache manifest.        - name: Push base image -        uses: docker/build-push-action@v2 +        uses: docker/build-push-action@v3          with:            context: .            file: ./Dockerfile @@ -89,7 +93,7 @@ jobs:        # Push the venv image to GHCR, with an inline cache manifest.        - name: Push venv image -        uses: docker/build-push-action@v2 +        uses: docker/build-push-action@v3          with:            context: .            file: ./Dockerfile diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index cccdb89..79856ba 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -11,11 +11,11 @@ jobs:      steps:        - name: Checkout code -        uses: actions/checkout@v2 +        uses: actions/checkout@v3        - name: Set up Python          id: python -        uses: actions/setup-python@v2 +        uses: actions/setup-python@v4          with:            python-version: "3.11"            cache: pip @@ -25,7 +25,7 @@ jobs:          run: pip install -U -r requirements/lint.pip        - name: Pre-commit environment cache -        uses: actions/cache@v2 +        uses: actions/cache@v3          with:            path: ${{ env.PRE_COMMIT_HOME }}            key: "precommit-0-${{ runner.os }}-${{ env.PRE_COMMIT_HOME }}-\ diff --git a/.github/workflows/sentry_release.yaml b/.github/workflows/sentry_release.yaml index 7d84946..9b4109e 100644 --- a/.github/workflows/sentry_release.yaml +++ b/.github/workflows/sentry_release.yaml @@ -10,7 +10,7 @@ jobs:      runs-on: ubuntu-latest      steps:        - name: Checkout code -        uses: actions/checkout@v2 +        uses: actions/checkout@v3          with:            # The version script relies on history. Fetch 100 commits to be safe.            fetch-depth: 100 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 97fb566..c0efbe4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -27,7 +27,7 @@ jobs:        # Needed for the Docker Compose file.        - name: Checkout code -        uses: actions/checkout@v2 +        uses: actions/checkout@v3        # Memory limit tests would fail if this isn't disabled.        - name: Disable swap memory @@ -47,7 +47,7 @@ jobs:        # Upload it so the coverage from all matrix jobs can be combined later.        - name: Upload coverage data -        uses: actions/upload-artifact@v2 +        uses: actions/upload-artifact@v3          with:            name: coverage            path: .coverage.* @@ -60,10 +60,10 @@ jobs:      steps:        - name: Checkout code -        uses: actions/checkout@v2 +        uses: actions/checkout@v3        - name: Set up Python -        uses: actions/setup-python@v2 +        uses: actions/setup-python@v4          with:            python-version: "3.11"            cache: pip @@ -73,7 +73,7 @@ jobs:          run: pip install -U -r requirements/coverage.pip        - name: Download coverage data -        uses: actions/download-artifact@v2 +        uses: actions/download-artifact@v3          with:            name: coverage | 
