From 8f936af4af19dffd33107154fd543903d2f491fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Urban?= Date: Sat, 30 Sep 2023 21:04:45 +0200 Subject: [PATCH] fix(infra): fix github actions --- .github/workflows/release-prod.yml | 7 ++-- .github/workflows/release.yml | 51 +++++++++++++++--------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/release-prod.yml b/.github/workflows/release-prod.yml index a3422d0..a89a8e7 100644 --- a/.github/workflows/release-prod.yml +++ b/.github/workflows/release-prod.yml @@ -36,10 +36,9 @@ jobs: - name: Build working-directory: frontend run: npm run build - - name: Copy Frontend distributable - run: cp -r frontend/dist src/main/resources - name: Install dependencies - run: go get . + working-directory: backend + run: go get ./... - name: Build working-directory: backend run: go build -o build/kubevoyage ./cmd/kubevoyage @@ -50,7 +49,7 @@ jobs: with: name: production-artifacts path: | - backend/build/ + backend/ frontend/public build-docker: needs: build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f0ee814..87db31e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,10 +36,9 @@ jobs: - name: Build working-directory: frontend run: npm run build - - name: Copy Frontend distributable - run: cp -r frontend/dist src/main/resources - name: Install dependencies - run: go get . + working-directory: backend + run: go get ./... - name: Build working-directory: backend run: go build -o build/kubevoyage ./cmd/kubevoyage @@ -50,7 +49,7 @@ jobs: with: name: production-artifacts path: | - backend/build/ + backend/ frontend/public build-docker: needs: build @@ -79,28 +78,30 @@ jobs: context: . push: true tags: ${{ secrets.DOCKERHUB_USERNAME }}/kubevoyage:${{ env.BRANCH_NAME }} - - pulumi-deploy: - needs: build-docker + release: + # depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions + # see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token + permissions: + contents: write runs-on: ubuntu-latest steps: - - name: Checkout code + - name: Checkout uses: actions/checkout@v3 - - run: npm install - working-directory: deploy - - name: Decode kubeconfig - run: | - mkdir -p $HOME/.kube - echo "${{ secrets.KUBE_CONFIG }}" | base64 -d > $HOME/.kube/config - cat $HOME/.kube/config - shell: bash - - name: Deploy with Pulumi - uses: pulumi/actions@v4 with: - command: up - stack-name: dev - work-dir: deploy - env: - PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} - registryImage: ${{ secrets.DOCKERHUB_USERNAME }}/kubevoyage - imageTag: ${{ github.head_ref || github.ref_name }} + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Install Helm + uses: azure/setup-helm@v3 + + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.5.0 + env: + PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} + registryImage: ${{ secrets.DOCKERHUB_USERNAME }}/kubevoyage + imageTag: ${{ github.head_ref || github.ref_name }} + CR_TOKEN: ${{ secrets.PAT }} \ No newline at end of file