Skip to content

Commit

Permalink
tag after docker and helm jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
JorritSalverda committed Jan 3, 2022
1 parent 12ca1a9 commit 5cad65d
Showing 1 changed file with 49 additions and 43 deletions.
92 changes: 49 additions & 43 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5cad65d

Please sign in to comment.