-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
paths-ignore: | ||
- './*.md' | ||
tags: | ||
- 'v[0-9]+.[0-9]+.*' | ||
branches: | ||
- master | ||
|
||
env: | ||
DOCKER_USERNAME: ${{ vars.GHCR_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.GHCR_TOKEN }} | ||
FORCE_COLOR: 1 | ||
|
||
jobs: | ||
release: | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Docker Login | ||
run: docker login ghcr.io/librepod --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD" | ||
|
||
- name: Download latest earthly | ||
run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.8.3/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'" | ||
|
||
- name: Put back the git branch into git (Earthly uses it for tagging) | ||
run: | | ||
branch="" | ||
if [ -n "$GITHUB_HEAD_REF" ]; then | ||
branch="$GITHUB_HEAD_REF" | ||
else | ||
branch="${GITHUB_REF##*/}" | ||
fi | ||
git checkout -b "$branch" || true | ||
- name: Build and push docker image | ||
run: | | ||
earthly --ci --push +build \ | ||
--TARGET_DOCKER_REGISTRY=quay.io/librepod \ | ||
--ARGOCD_TAG=v2.9.6 \ | ||
--ARGOCD_BASE_IMAGE=quay.io/argoproj/argocd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.arg | ||
.secret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
VERSION 0.7 | ||
|
||
ARG --global TARGET_DOCKER_REGISTRY | ||
|
||
build: | ||
ARG ARGOCD_TAG=v2.9.6 | ||
ARG ARGOCD_BASE_IMAGE=quay.io/argoproj/argocd | ||
FROM ${ARGOCD_BASE_IMAGE}:${ARGOCD_TAG} | ||
|
||
# Switch to root for the ability to perform install | ||
USER root | ||
|
||
RUN apt-get update | ||
|
||
# Setup non-root user | ||
WORKDIR /home/argocd | ||
|
||
RUN apt-get update && apt-get --no-install-recommends --yes install \ | ||
jq curl \ | ||
&& curl -L -o yq_linux_amd64.tar.gz https://github.com/mikefarah/yq/releases/download/v4.2.0/yq_linux_amd64.tar.gz \ | ||
&& tar xzf ./yq_linux_amd64.tar.gz \ | ||
&& chmod +x ./yq_linux_amd64 && mv ./yq_linux_amd64 /usr/local/bin/yq \ | ||
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ | ||
&& apt-get install -y nodejs \ | ||
&& npm install -g pnpm cdk8s \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
# Switch back to non-root user | ||
USER 999 | ||
|
||
SAVE IMAGE --push ${TARGET_DOCKER_REGISTRY}/argocd-cdk8s:$ARGOCD_TAG |