Compare commits

..

No commits in common. "802e6498c832852c22164c5d3242dc3742aee67d" and "0e831b0fb52b30d84c48ff6d12bbc8e8d0d81f60" have entirely different histories.

View File

@ -16,7 +16,7 @@ on:
env: env:
# Use docker.io for Docker Hub if empty # Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io REGISTRY: ghcr.io
REGISTRY2: registry.cn-shenzhen.aliyuncs.com REGISTRY2: git.suyiiyii.top
# github.repository as <account>/<repo> # github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }} IMAGE_NAME: ${{ github.repository }}
@ -63,13 +63,6 @@ jobs:
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Get current date and commit ID
id: vars
run: |
echo "DATE=$(date +'%y%m%d')" >> $GITHUB_ENV
echo "COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
# Extract metadata (tags, labels) for Docker # Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action # https://github.com/docker/metadata-action
- name: Extract Docker metadata - name: Extract Docker metadata
@ -77,7 +70,6 @@ jobs:
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0 uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with: with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.service }} images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.service }}
tags: ${{ env.DATE }}-${{ env.COMMIT }}
# Build and push Docker image with Buildx (don't push on PR) # Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action # https://github.com/docker/build-push-action
@ -100,8 +92,8 @@ jobs:
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with: with:
registry: ${{ env.REGISTRY2 }} registry: ${{ env.REGISTRY2 }}
username: ${{ secrets.ALI_REG_USERNAME }} username: ${{ github.actor }}
password: ${{ secrets.ALI_REG_PASSWORD }} password: ${{ secrets.GITEATOKEN }}
# Extract metadata (tags, labels) for Docker # Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action # https://github.com/docker/metadata-action
@ -110,7 +102,6 @@ jobs:
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0 uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with: with:
images: ${{ env.REGISTRY2 }}/${{ env.IMAGE_NAME }}-${{ matrix.service }} images: ${{ env.REGISTRY2 }}/${{ env.IMAGE_NAME }}-${{ matrix.service }}
tags: ${{ env.DATE }}-${{ env.COMMIT }}
# Build and push Docker image with Buildx (don't push on PR) # Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action # https://github.com/docker/build-push-action
@ -139,33 +130,3 @@ jobs:
# This step uses the identity token to provision an ephemeral certificate # This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance. # against the sigstore community Fulcio instance.
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
outputs:
version: ${{ steps.meta.outputs.version }}
update-manifest:
runs-on: ubuntu-latest
needs: [ "build" ]
permissions:
contents: write
steps:
- name: Checkout manifest
if: github.event_name == 'push'
uses: actions/checkout@v4
with:
ref: manifest
token: ${{ secrets.GITHUBTOKEN }}
- name: Update manifest
if: github.event_name == 'push'
uses: mikefarah/yq@master
with:
cmd: yq eval '.tag = "${{ needs.build.outputs.version }}"' -i values.yaml
- name: Git Auto Commit
if: github.event_name == 'push'
uses: stefanzweifel/git-auto-commit-action@v5.0.1
with:
commit_message: "Update deployment image tag to ${{ needs.build.outputs.version }}"
branch: manifest
commit_user_name: "github-actions[bot]"
commit_user_email: "github-actions[bot]@users.noreply.github.com"
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"