Skip to content

Commit

Permalink
change login user and token for ghcr.io & small refactor (#2268)
Browse files Browse the repository at this point in the history
Signed-off-by: kpango <[email protected]>
  • Loading branch information
kpango authored and kmrmt committed Dec 12, 2023
1 parent 8978f27 commit 31ee833
Show file tree
Hide file tree
Showing 29 changed files with 94 additions and 98 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/_docker-image-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set Git config
run: |
Expand Down
38 changes: 17 additions & 21 deletions .github/workflows/_docker-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,15 @@ on:
description: "If it is specified, specified platforms will be used."
required: false
default: ""

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref != 'refs/heads/main' && github.ref || github.sha }}-${{ github.event_name }}-${{ inputs.target }}
cancel-in-progress: true

jobs:
dump-contexts-to-log:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

build:
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) || (github.event.pull_request.head.repo.fork == true && github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci/approved')) || (github.event_name == 'push' && github.ref == 'refs/heads/main') || startsWith( github.ref, 'refs/tags/') }}
Expand All @@ -50,59 +47,58 @@ jobs:
else
echo ref=${{ github.sha }} >> $GITHUB_OUTPUT
fi
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ steps.ref.outputs.ref }}

- name: Set Git config
run: |
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
with:
platforms: all

image: tonistiigi/binfmt:master
platforms: linux/amd64,linux/arm64
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: "--debug"

version: latest
platforms: linux/amd64,linux/arm64
driver-opts: |
image=moby/buildkit:master
network=host
buildkitd-flags: "--debug --oci-worker-gc=false"
- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ secrets.PACKAGE_USER }}
password: ${{ secrets.PACKAGE_TOKEN }}

- name: Build and Publish
id: build_and_publish
uses: ./.github/actions/docker-build
with:
target: ${{ inputs.target }}
platforms: ${{ inputs.platforms }}
builder: ${{ steps.buildx.outputs.name }}

- name: Scan the Docker image
if: startsWith( github.ref, 'refs/tags/')
uses: ./.github/actions/scan-docker-image
with:
image_ref: "${{ steps.build_and_publish.outputs.IMAGE_NAME }}:${{ steps.build_and_publish.outputs.PRIMARY_TAG }}"

slack:
runs-on: ubuntu-latest
needs: [build]
if: github.ref == 'refs/heads/main' || startsWith( github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/notify-slack
with:
author_name: ${{ inputs.target }} image build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ jobs:
dump-contexts-to-log:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

build-linux:
runs-on: ubuntu-latest
container:
image: ghcr.io/vdaas/vald/vald-ci-container:nightly
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 10

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-protobuf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ jobs:
dump-contexts-to-log:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

build:
runs-on: ubuntu-latest
container:
image: ghcr.io/vdaas/vald/vald-ci-container:nightly
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set Git config
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/chatops-help.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
dump-contexts-to-log:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

print:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/chatops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
dump-contexts-to-log:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

label:
Expand Down Expand Up @@ -131,7 +131,7 @@ jobs:
BRANCH: ${{ steps.check_comments_rebase.outputs.BRANCH_NAME }}
USERNAME: ${{ steps.check_comments_rebase.outputs.COMMENTER_USERNAME }}

- uses: actions/checkout@v3
- uses: actions/checkout@v4
if: steps.check_comments_rebase.outputs.BOOL_TRIGGERED == 'true' && steps.check_permissions.outputs.EXECUTABLE == 'true'
with:
fetch-depth: 0
Expand Down Expand Up @@ -216,7 +216,7 @@ jobs:
PR_AUTHOR: ${{ github.event.issue.user.login }}
API_URL: ${{ github.event.issue.comments_url }}

- uses: actions/checkout@v3
- uses: actions/checkout@v4
if: steps.check_comments_gen_test.outputs.BOOL_TRIGGERED == 'true' && steps.check_permissions.outputs.EXECUTABLE == 'true'
with:
fetch-depth: 0
Expand Down Expand Up @@ -340,7 +340,7 @@ jobs:
USERNAME: ${{ steps.check_comments_format.outputs.COMMENTER_USERNAME }}
API_URL: ${{ github.event.issue.comments_url }}

- uses: actions/checkout@v3
- uses: actions/checkout@v4
if: steps.check_comments_format.outputs.BOOL_TRIGGERED == 'true' && steps.check_permissions.outputs.EXECUTABLE == 'true'
with:
fetch-depth: 0
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
dump-contexts-to-log:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

codeql-build:
Expand All @@ -46,7 +46,7 @@ jobs:
image: ghcr.io/vdaas/vald/vald-ci-container:nightly
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ jobs:
dump-contexts-to-log:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

coverage:
runs-on: ubuntu-latest
container:
image: ghcr.io/vdaas/vald/vald-ci-container:nightly
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 10

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/detect-internal-config-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
dump-contexts-to-log:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

warning:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dockers-image-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
dump-contexts-to-log:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

agent-ngt:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/e2e-chaos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-chaos'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

agent-failure:
Expand All @@ -44,7 +44,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set Git config
run: |
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set Git config
run: |
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set Git config
run: |
Expand Down Expand Up @@ -176,7 +176,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set Git config
run: |
Expand Down Expand Up @@ -223,7 +223,7 @@ jobs:
- clusterwide-network-bandwidth
- random-pod-failure
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ./.github/actions/notify-slack
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/e2e-code-bench-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
dump-contexts-to-log:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

grpc-sequential:
Expand All @@ -59,7 +59,7 @@ jobs:
container:
image: ghcr.io/vdaas/vald/vald-ci-container:nightly
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set Git config
run: |
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
container:
image: ghcr.io/vdaas/vald/vald-ci-container:nightly
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set Git config
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/e2e-max-dim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-max-dim'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

e2e-max-dimension-insert:
Expand All @@ -40,7 +40,7 @@ jobs:
timeout-minutes: 60

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set Git config
run: |
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
runs-on: ubuntu-latest
if: startsWith( github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ./.github/actions/notify-slack
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-profiling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
if: startsWith( github.ref, 'refs/tags/') || github.event.action == 'labeled' && github.event.label.name == 'actions/e2e-profiling'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/dump-context

e2e-profiling:
Expand All @@ -42,7 +42,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set Git config
run: |
Expand Down
Loading

0 comments on commit 31ee833

Please sign in to comment.