Skip to content

Commit

Permalink
ci: rework logic
Browse files Browse the repository at this point in the history
  • Loading branch information
fredleger committed Feb 20, 2024
1 parent 0f5f172 commit 6f53623
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 57 deletions.
54 changes: 53 additions & 1 deletion .github/workflows/__shared-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
file: coverage.lcov
allow-empty: true

ct-lint:
chart-testing:
runs-on: self-hosted
steps:

Expand Down Expand Up @@ -100,3 +100,55 @@ jobs:
- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }}

skaffold-build:
name: πŸ‘·β€β™‚οΈ Run skaffold build
needs: ci
runs-on: self-hosted
steps:
# Login to docker hub
- name: πŸ”’ Login to hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
registry: docker.io

# Get a local copy of the code
- uses: actions/checkout@v4

# Prepare cache storage
- name: ♻️ Cache skaffold dirs
uses: actions/cache@v4
env:
cache-name: cache-skaffold
with:
path: /home/runner/.skaffold
key: skaffold-${{ github.sha }}
restore-keys: |
skaffold-
# Install tools with asdf
- name: πŸ“¦ Install tools with asdf
uses: asdf-vm/actions/install@v3

# install buildx
# FIXME: should not this being done upstream ?
- name: πŸ“¦ Install buildx
run: |
echo "+ install buildx"
wget -O ~/.docker/cli-plugins/docker-buildx https://github.com/docker/buildx/releases/download/v0.12.1/buildx-v0.12.1.linux-amd64
chmod a+x ~/.docker/cli-plugins/docker-buildx
docker buildx create --name multiarch --use
docker buildx inspect --bootstrap
env:
DOCKER_CLI_EXPERIMENTAL: enabled

# Run a skaffold build
- name: 🏭 Run skaffold build
uses: hiberbee/[email protected]
with:
skaffold-version: 2.8.0
command: build
repository: ${{ vars.SKAFFOLD_DEFAULT_REPO }}
tag: ${{ github.event.inputs.tagVersion }}
8 changes: 4 additions & 4 deletions .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ permissions:

jobs:

ci:
name: Continuous Integration
uses: ./.github/workflows/__shared-ci.yml

update_release_draft:
permissions:
contents: write
Expand All @@ -22,7 +26,3 @@ jobs:
with:
publish: true
disable-autolabeler: true

ci:
name: Continuous Integration
uses: ./.github/workflows/__shared-ci.yml
52 changes: 0 additions & 52 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,58 +27,6 @@ jobs:
name: Continuous Integration
uses: ./.github/workflows/__shared-ci.yml

skaffold-build:
name: πŸ‘·β€β™‚οΈ Run skaffold build
needs: ci
runs-on: self-hosted
steps:
# Login to docker hub
- name: πŸ”’ Login to hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
registry: docker.io

# Get a local copy of the code
- uses: actions/checkout@v4

# Prepare cache storage
- name: ♻️ Cache skaffold dirs
uses: actions/cache@v4
env:
cache-name: cache-skaffold
with:
path: /home/runner/.skaffold
key: skaffold-${{ github.sha }}
restore-keys: |
skaffold-
# Install tools with asdf
- name: πŸ“¦ Install tools with asdf
uses: asdf-vm/actions/install@v3

# install buildx
# FIXME: should not this being done upstream ?
- name: πŸ“¦ Install buildx
run: |
echo "+ install buildx"
wget -O ~/.docker/cli-plugins/docker-buildx https://github.com/docker/buildx/releases/download/v0.12.1/buildx-v0.12.1.linux-amd64
chmod a+x ~/.docker/cli-plugins/docker-buildx
docker buildx create --name multiarch --use
docker buildx inspect --bootstrap
env:
DOCKER_CLI_EXPERIMENTAL: enabled

# Run a skaffold build
- name: 🏭 Run skaffold build
uses: hiberbee/[email protected]
with:
skaffold-version: 2.8.0
command: build
repository: ${{ vars.SKAFFOLD_DEFAULT_REPO }}
tag: ${{ github.event.inputs.tagVersion }}

helm-push:
name: πŸ‘·β€β™‚οΈ Run helm push
needs: ci
Expand Down

0 comments on commit 6f53623

Please sign in to comment.