Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: push to OCI registries #4

Merged
merged 2 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand All @@ -24,18 +24,17 @@ jobs:
run: cat $TEST_VALUES_PATH.tpl | envsubst > $TEST_VALUES_PATH

- name: Set up Helm
uses: azure/setup-helm@v1
uses: azure/setup-helm@v3
with:
version: v3.8.1
version: v3.12.1

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: '3.9'
check-latest: true

- name: Set up chart-testing
uses: helm/[email protected]
with:
version: v3.6.0
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
Expand All @@ -55,7 +54,7 @@ jobs:
run: ct lint --target-branch ${{ github.base_ref }}

- name: Create kind cluster
uses: helm/kind-action@v1.3.0
uses: helm/kind-action@v1.4.0
if: steps.list-changed.outputs.changed == 'true'

- name: Install postgres service to kind cluster
Expand Down
34 changes: 32 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ on:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand All @@ -19,11 +22,38 @@ jobs:
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

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

- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.11.2

- name: Add dependancies
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami

- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.4.0
uses: helm/chart-releaser-action@v1.5.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: Push Helm Chart to OCI Registries
run: |
REPO_OWNER=`echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]'`
# Get packed chart file name
PKG_NAME=`ls .cr-release-packages/*.tgz`
# pushing chart to OCI registries
helm push ${PKG_NAME} oci://registry-1.docker.io/cartesi
helm push ${PKG_NAME} oci://ghcr.io/${REPO_OWNER}/charts
Loading