-
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
1 parent
12ca1a9
commit 5cad65d
Showing
1 changed file
with
49 additions
and
43 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 |
---|---|---|
|
@@ -16,60 +16,66 @@ jobs: | |
versionSpec: '5.x' | ||
- id: gitversion | ||
uses: gittools/actions/gitversion/[email protected] | ||
- run: | | ||
git tag -f $GITVERSION_SEMVER | ||
git push origin $GITVERSION_SEMVER | ||
|
||
docker: | ||
runs-on: ubuntu-latest | ||
needs: gitversion | ||
env: | ||
GITVERSION_SEMVER: ${{ needs.gitversion.outputs.semVer }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: docker/setup-buildx-action@v1 | ||
- uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build docker image | ||
run: | | ||
IMAGE_NAME="jsalverda/jarvis-alpha-innotec-exporter" | ||
# https://docs.openfn.org/articles/2021/10/08/improving-multistage-docker-builds-using-buildx/ | ||
docker buildx build \ | ||
--tag $IMAGE_NAME:$GITVERSION_SEMVER \ | ||
--cache-from=type=registry,ref=$IMAGE_NAME-build-cache \ | ||
--cache-to=type=registry,ref=$IMAGE_NAME-build-cache,mode=max \ | ||
--file Dockerfile \ | ||
--push \ | ||
--progress=plain \ | ||
. | ||
- uses: actions/checkout@v2 | ||
- uses: docker/setup-buildx-action@v1 | ||
- uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build docker image | ||
run: | | ||
IMAGE_NAME="jsalverda/jarvis-alpha-innotec-exporter" | ||
# https://docs.openfn.org/articles/2021/10/08/improving-multistage-docker-builds-using-buildx/ | ||
docker buildx build \ | ||
--tag $IMAGE_NAME:$GITVERSION_SEMVER \ | ||
--cache-from=type=registry,ref=$IMAGE_NAME-build-cache \ | ||
--cache-to=type=registry,ref=$IMAGE_NAME-build-cache,mode=max \ | ||
--file Dockerfile \ | ||
--push \ | ||
--progress=plain \ | ||
. | ||
helm: | ||
runs-on: ubuntu-latest | ||
needs: [gitversion, docker] | ||
env: | ||
GITVERSION_SEMVER: ${{ needs.gitversion.outputs.semVer }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: azure/setup-helm@v1 | ||
- run: helm lint --with-subcharts helm/jarvis-alpha-innotec-exporter | ||
- run: helm package --app-version $GITVERSION_SEMVER --version $GITVERSION_SEMVER --dependency-update helm/jarvis-alpha-innotec-exporter | ||
- uses: actions/checkout@v2 | ||
with: | ||
repository: JorritSalverda/helm-charts | ||
ref: master | ||
path: helm-charts | ||
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
- run: | | ||
mkdir -p helm-charts/charts | ||
cp jarvis-alpha-innotec-exporter-${GITVERSION_SEMVER}.tgz helm-charts/charts | ||
cd helm-charts | ||
helm repo index --url https://helm.jorritsalverda.com/ . | ||
git config user.email '[email protected]' | ||
git config user.name 'estafette-bot' | ||
git add --all | ||
git commit --allow-empty -m "jarvis-alpha-innotec-exporter $GITVERSION_SEMVER" | ||
git push origin master | ||
- uses: actions/checkout@v2 | ||
- uses: azure/setup-helm@v1 | ||
- run: helm lint --with-subcharts helm/jarvis-alpha-innotec-exporter | ||
- run: helm package --app-version $GITVERSION_SEMVER --version $GITVERSION_SEMVER --dependency-update helm/jarvis-alpha-innotec-exporter | ||
- uses: actions/checkout@v2 | ||
with: | ||
repository: JorritSalverda/helm-charts | ||
ref: master | ||
path: helm-charts | ||
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
- run: | | ||
mkdir -p helm-charts/charts | ||
cp jarvis-alpha-innotec-exporter-${GITVERSION_SEMVER}.tgz helm-charts/charts | ||
cd helm-charts | ||
helm repo index --url https://helm.jorritsalverda.com/ . | ||
git config user.email '[email protected]' | ||
git config user.name 'estafette-bot' | ||
git add --all | ||
git commit --allow-empty -m "jarvis-alpha-innotec-exporter $GITVERSION_SEMVER" | ||
git push origin master | ||
tag: | ||
runs-on: ubuntu-latest | ||
needs: [gitversion, docker, helm] | ||
env: | ||
GITVERSION_SEMVER: ${{ needs.gitversion.outputs.semVer }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: | | ||
git tag -f $GITVERSION_SEMVER | ||
git push origin $GITVERSION_SEMVER |