Skip to content

Commit

Permalink
bbb
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-cox committed Apr 23, 2024
1 parent ca31f82 commit 54ca13f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 86 deletions.
91 changes: 9 additions & 82 deletions .github/workflows/build-and-upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,38 @@ jobs:
with:
fetch-depth: 1

- name: Setup local environment
- name: Setup env
uses: ./.github/actions/setup

- id: build
name: Build
run: ./scripts/build-static

- name: fFetch gcs auth
- name: Get gcs auth
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/google-auth/rancher/credentials token | GOOGLE_AUTH
# https://github.com/google-github-actions/auth
- name: auth with gcs
- name: Apply gcs auth
# https://github.com/google-github-actions/auth
uses: 'google-github-actions/auth@v2'
with:
credentials_json: "${{ env.GOOGLE_AUTH }}"

# https://github.com/google-github-actions/upload-cloud-storage
- name: upload build
- name: Upload build
uses: 'google-github-actions/upload-cloud-storage@v2'
# https://github.com/google-github-actions/upload-cloud-storage
with:
path: ${{steps.build.outputs.BUILD_DIR}}
# Example - https://releases.rancher.com/ui/2.8.0/...
destination: releases.rancher.com/${{ env.REPO }}/${{ steps.build.outputs.VERSION }}
parent: false
headers: |-
cache-control: no-cache,must-revalidate
process_gcloudignore: false

- name: upload tar
- name: Upload tar
if: ${{ env.CI_BUILD_TAG != ''}}
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
Expand All @@ -63,78 +64,4 @@ jobs:
parent: false
headers: |-
cache-control: no-cache,must-revalidate
# # TODO RC if we can use upload permissions in a single job with build then these aren't needed
# - name: Stash build (files)
# uses: actions/upload-artifact@v4
# with:
# name: BUILD_DIR
# path: ${{ steps.build.outputs.BUILD_DIR }}
# retention-days: 1

# - name: Stash build (archive file)
# if: ${{ env.CI_BUILD_TAG != ''}}
# uses: actions/upload-artifact@v4
# with:
# name: BUILD_TGZ
# path: ${{ steps.build.outputs.BUILD_TGZ }}
# retention-days: 1

# - name: Stash VERSION
# run: echo "VERSION=${{ steps.build.outputs.VERSION }}" >> "$GITHUB_OUTPUT"
# upload:
# runs-on: ubuntu-latest
# needs: build
# # env:
# # GS_BUCKET_NAME:
# steps:
# - name: Download build directory
# uses: actions/download-artifact@v4
# with:
# name: BUILD_DIR
# path: build_dir
# - name: Download build tar
# if: ${{ env.CI_BUILD_TAG != ''}}
# uses: actions/download-artifact@v4
# with:
# name: BUILD_TGZ
# path: build_tgz
# # - name: version (TODO RC remove)
# # run: echo ${{needs.build.outputs.VERSION}}
# # - name: build_dir output (TODO RC remove)
# # run: ls -l build_dir
# - name: build_tgz output (TODO RC remove)
# if: ${{ env.CI_BUILD_TAG != ''}}
# run: ls -l build_tgz
# - uses: rancher-eio/read-vault-secrets@main
# with:
# secrets: |
# secret/data/github/repo/${{ github.repository }}/google-auth/rancher/credentials token | GOOGLE_AUTH
# # https://github.com/google-github-actions/auth
# - name: auth
# uses: 'google-github-actions/auth@v2'
# with:
# credentials_json: "${{ env.GOOGLE_AUTH }}"
# # https://github.com/google-github-actions/upload-cloud-storage
# - name: upload build
# uses: 'google-github-actions/upload-cloud-storage@v2'
# with:
# path: build_dir
# # Example - https://releases.rancher.com/ui/2.8.0/...
# destination: releases.rancher.com/${{ env.REPO }}/${{ needs.build.outputs.VERSION }}
# parent: false
# headers: |-
# cache-control: no-cache,must-revalidate
# - name: upload tar
# if: ${{ env.CI_BUILD_TAG != ''}}
# uses: 'google-github-actions/upload-cloud-storage@v2'
# with:
# path: build_tgz
# # Example - https://releases.rancher.com/ui/2.8.0.tar.gz
# destination: releases.rancher.com/${{ env.REPO }}
# parent: false
# headers: |-
# cache-control: no-cache,must-revalidate
process_gcloudignore: false
2 changes: 1 addition & 1 deletion .github/workflows/build-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
# TODO RC - uncomment
# - master
# - 'release-*'
- richard-drone-ui
- richard-drone-ui-sjdkfldsgfdsf
jobs:
# test:
# uses: ./.github/workflows/test.yaml
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ env:
ENVIRONMENT: production

jobs:
test:
uses: ./.github/workflows/test.yaml
# test:
# uses: ./.github/workflows/test.yaml
build-and-upload:
needs: test
uses: ./.github/workflows/build-and-upload.yaml
# needs: test
permissions:
contents: 'read'
id-token: 'write'
with:
CI_BUILD_TAG: ${{github.ref_name}}

0 comments on commit 54ca13f

Please sign in to comment.