From b8b191e724af6549e6deffa0728589fa72596a96 Mon Sep 17 00:00:00 2001 From: Young Date: Tue, 14 Nov 2023 14:29:11 -0700 Subject: [PATCH] Create update_heatcluster.yml --- .github/workflows/update_heatcluster.yml | 65 ++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/update_heatcluster.yml diff --git a/.github/workflows/update_heatcluster.yml b/.github/workflows/update_heatcluster.yml new file mode 100644 index 0000000..0b97ceb --- /dev/null +++ b/.github/workflows/update_heatcluster.yml @@ -0,0 +1,65 @@ +name: Update HeatCluster +on: + workflow_dispatch: + schedule: + - cron: '30 5 * * TUE' + +run-name: Updating HeatCluster + +jobs: + update: + runs-on: ubuntu-latest + steps: + - name: Get latest HeatCluster release + uses: rez0n/actions-github-release@main + id: latest + with: + token: ${{ secrets.GITHUB_TOKEN }} + repository: DrB-S/heatcluster + + - name: Remove V + id: strip + run: | + version=$(echo "${{ steps.latest.outputs.release }}" | sed 's/V//g' | sed 's/v//g' ) + echo "The version is $version" + echo "version=$version" >> $GITHUB_OUTPUT + + - name: Get current date + id: date + run: | + date=$(date '+%Y-%m-%d') + echo "the date is $date" + echo "date=$date" >> $GITHUB_OUTPUT + + - name: pull repo + uses: actions/checkout@v3 + + - name: check paths + run: ls && ls ./heatcluster + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Quay + uses: docker/login-action@v2 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + + - name: Build and push to Quay + uses: docker/build-push-action@v3 + with: + file: ./heatcluster/Dockerfile + build-args: HEATCLUSTER_VER=${{ steps.strip.outputs.version }} + push: true + tags: quay.io/uphl/heatcluster:${{ steps.strip.outputs.version }}-${{ steps.date.outputs.date }} + + - name: Build and push latest tag to Quay + uses: docker/build-push-action@v3 + with: + file: ./heatcluster/Dockerfile + build-args: HEATCLUSTER_VER=${{ steps.strip.outputs.version }} + push: true + tags: quay.io/uphl/heatcluster:latest