0pens0 deploying #9
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: Deploy gitops project | |
run-name: ${{ github.actor }} deploying | |
on: | |
push: | |
branches: | |
- "gitops" | |
jobs: | |
gitops-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Tanzu CLI | |
run: | | |
TANZU_CLI_VERSION=v1.3.0 | |
curl -Lo tanzu-cli-linux-amd64.tar.gz https://github.com/vmware-tanzu/tanzu-cli/releases/download/${TANZU_CLI_VERSION}/tanzu-cli-linux-amd64.tar.gz | |
curl -Lo tanzu-cli-binaries-checksums.txt https://github.com/vmware-tanzu/tanzu-cli/releases/download/${TANZU_CLI_VERSION}/tanzu-cli-binaries-checksums.txt | |
if [ "$(cat tanzu-cli-binaries-checksums.txt | grep tanzu-cli-linux-amd64.tar.gz)" != "$(sha256sum tanzu-cli-linux-amd64.tar.gz)" ]; then echo "Checksum does not match"; exit 1; fi | |
tar -xf tanzu-cli-linux-amd64.tar.gz | |
mv ${TANZU_CLI_VERSION}/tanzu-cli-linux_amd64 /usr/local/bin/tanzu | |
tanzu ceip-participation set false | |
tanzu config eula accept | |
tanzu init | |
tanzu version | |
- name: Install tanzu plugins | |
run: | | |
tanzu plugin install build | |
tanzu plugin install resource | |
tanzu plugin install project | |
tanzu plugin install space | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Deploy | |
env: | |
TANZU_API_TOKEN: ${{ secrets.API_TOKEN }} | |
ENDPOINT: ${{ secrets.API_ENDPOINT || 'console.cloud.vmware.com' }} | |
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }} | |
REGISTRY_PASS: ${{ secrets.RERGISTRY_PASS}} | |
run: | | |
tanzu login --endpoint ${ENDPOINT} | |
tanzu build config --build-plan-source-type=file --build-plan-source conf/platform-config.yml --containerapp-registry harbor.vmtanzu.com/openso-tap-apps/{name} | |
tanzu build config view | |
tanzu context list --wide | |
tanzu project list | |
docker login ${REGISTRY} -u openso -p ${REGISTRY_PASS} | |
tanzu project use ${{ secrets.PROJECT_NAME }} | |
tanzu space list | |
tanzu space use ${{ secrets.SPACE_NAME }} | |
#git clone https://github.com/0pens0/spring-metal | |
#cd spring-metal | |
tanzu deploy -y --diff | |
- run: echo "🍏 This job's status is ${{ job.status }}." |