From 719eaa9850d4876345f511f047447e4e67a409b0 Mon Sep 17 00:00:00 2001 From: eQuantum <8466209+eq19@users.noreply.github.com> Date: Wed, 26 Jun 2024 09:11:19 +0700 Subject: [PATCH] Update action.yml --- action.yml | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 9b85e866462..de6d7d9c4c7 100644 --- a/action.yml +++ b/action.yml @@ -39,5 +39,47 @@ branding: icon: 'command' color: 'red' runs: - using: 'docker' - image: 'Dockerfile' + #using: 'docker' + #image: 'Dockerfile' + using: composite + steps: + - name: 💎 Set Credential + id: 'auth' + uses: 'google-github-actions/auth@v2' + with: + credentials_json: ${{ inputs.credentials }} + + - name: 💎 Authentication + uses: 'google-github-actions/setup-gcloud@v2' + with: + install_components: 'alpha,cloud-datastore-emulator' + + - name: 💎 Determine which runner to use + uses: actions/github-script@v7 + with: + result-encoding: string + script: | + const { spawnSync } = require( 'child_process' ) + const ls = spawnSync('ls', [ '-lh', '/usr' ] ) + console.log( `stdout: ${ ls.stdout.toString() }` ) + + - name: 💎 Variables + shell: bash + id: variables + run: | + gcloud info + repo_name=${{ inputs.docker_hub_username }}/${{ inputs.image_name }} + image_tag=${{ inputs.image_tag }} + dev_image_tag="$image_tag" + repo_ref="$repo_name:$image_tag" + image_ref="${{ inputs.image_name }}:$image_tag" + dev_repo_ref="$repo_name:$dev_image_tag" + dev_image_ref="${{ inputs.image_name }}:$dev_image_tag" + + echo "repo_name=$repo_name" >> $GITHUB_OUTPUT + echo "image_tag=$image_tag" >> $GITHUB_OUTPUT + echo "dev_image_tag=$dev_image_tag" >> $GITHUB_OUTPUT + echo "repo_ref=$repo_ref" >> $GITHUB_OUTPUT + echo "image_ref=$image_ref" >> $GITHUB_OUTPUT + echo "dev_repo_ref=$dev_repo_ref" >> $GITHUB_OUTPUT + echo "dev_image_ref=$dev_image_ref" >> $GITHUB_OUTPUT