Force run #1
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
name: Release Charts | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: "0" | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "[email protected]" | |
- name: Install Helm | |
uses: azure/setup-helm@v1 | |
with: | |
version: v3.7.1 | |
# TODO: Maintainer of repository to follow: | |
# https://github.com/docker/login-action#google-container-registry-gcr to add credentials so | |
# we can push from github actions | |
# - name: log in to google container registry | |
# uses: docker/login-action@v1 | |
# with: | |
# registry: gcr.io | |
# username: ${{ secrets.DOCKER_USERNAME }} | |
# password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Login to Packages Container registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and Push Spark-Operator Docker Image to github container registry | |
run: | | |
DOCKER_TAG=$(cat charts/spark-operator-chart/Chart.yaml | grep "appVersion: .*" | cut -c13-) | |
docker build -t gcr.io/teamziax/spark-operator:${DOCKER_TAG} -f Dockerfile.rh . | |
echo "Ideally, we'd release the docker container at this point, but the maintainer of this repo needs to approve..." | |
docker tag gcr.io/teamziax/spark-operator:${DOCKER_TAG} ghcr.io/googlecloudplatform/spark-operator:${DOCKER_TAG} | |
if ! docker pull ghcr.io/teamziax/spark-operator:${DOCKER_TAG}; then | |
docker push ghcr.io/teamziax/spark-operator:${DOCKER_TAG} | |
else | |
echo "Spark-Operator Docker Image alredy exists" | |
fi | |
- name: Release Spark-Operator Docker Image | |
run: | | |
DOCKER_TAG=$(cat charts/spark-operator-chart/Chart.yaml | grep "appVersion: .*" | cut -c13-) | |
if git rev-parse -q --verify "refs/tags/$DOCKER_TAG"; then | |
echo "Spark-Operator Docker Image Tag $DOCKER_TAG already exists!" | |
else | |
git tag $DOCKER_TAG | |
git push origin $DOCKER_TAG | |
echo "Spark-Operator Docker Image new tag: $DOCKER_TAG released" | |
fi |