diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb787c2..c09abde 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,7 @@ on: types: [ published ] env: + REGISTRY: docker.io REPO: cashtrack/mysql jobs: @@ -14,17 +15,19 @@ jobs: permissions: contents: read packages: write + id-token: write + attestations: write steps: - name: Checkout repository if: github.event_name != 'pull_request' - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Login against a Docker registry except on PR # https://github.com/docker/login-action - name: Login to Docker Hub if: github.event_name != 'pull_request' - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USER }} password: ${{ secrets.DOCKER_HUB_TOKEN }} @@ -34,7 +37,7 @@ jobs: - name: Extract Docker metadata if: github.event_name != 'pull_request' id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: ${{ env.REPO }} tags: | @@ -44,7 +47,7 @@ jobs: # Setup BuildX # https://github.com/docker/setup-buildx-action - name: Setup BuildX - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 id: buildx with: install: true @@ -52,9 +55,18 @@ jobs: # Build and push Docker image with Build (don't push on PR) # https://github.com/docker/build-push-action - name: Build and push - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 + id: push with: context: . push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + + - name: Attest + uses: actions/attest-build-provenance@v1 + id: attest + with: + subject-name: ${{ env.REGISTRY }}/${{ env.REPO }} + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: true diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f16b4ea..6a81453 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,7 +13,7 @@ env: INFRA_REPO_REF: main CLUSTER: k8s-cash-track NAMESPACE: cash-track - KUBECTL_BIN: https://storage.googleapis.com/kubernetes-release/release/v1.24.4/bin/linux/amd64/kubectl + KUBECTL_BIN: https://storage.googleapis.com/kubernetes-release/release/v1.31.0/bin/linux/amd64/kubectl jobs: deploy: @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout infra repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: ${{ env.INFRA_REPO }} ref: ${{ env.INFRA_REPO_REF }} @@ -49,7 +49,7 @@ jobs: - name: Extract Docker metadata if: github.event_name != 'pull_request' id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: ${{ env.REPO }} tags: |