Skip to content

Commit

Permalink
Merge pull request #210 from katalon-studio/quidl-patch-1
Browse files Browse the repository at this point in the history
Update publish_agent.yml
  • Loading branch information
quidl authored Apr 19, 2024
2 parents bacd254 + bc6e2d8 commit 1a3a611
Showing 1 changed file with 70 additions and 70 deletions.
140 changes: 70 additions & 70 deletions .github/workflows/publish_agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,74 +216,74 @@ jobs:
run: npm run release

### DEPLOY ###
deploy:
name: Deploy cloud agent
environment: ${{ needs.set_env.outputs.ENV }}
env:
AGENT_VERSION: ${{ inputs.agent_version }}
needs: [set_env, build]

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install packages
run: npm install --only dev

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ vars.AWS_ACCOUNT_ID }}:role/katalon-github-oidc-federation
role-session-name: github-actions
aws-region: ${{ vars.AWS_REGION }}
mask-aws-account-id: 'no'

- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: .

- name: Add execute permission to downloaded artifacts
run: chmod +x katalon-agent-linux-*/* katalon-agent-macos-*/*


- name: Deploy to s3 prod
if: ${{ needs.set_env.outputs.ENV == 'prod' }}
run: |
ls -laR
aws s3 cp katalon-agent-linux-x64-*/cli-linux-x64 s3://${{ secrets.AWS_S3_BUCKET }}/katalon-agent/$AGENT_VERSION/cli-linux-x64
commit:
runs-on: ubuntu-latest
needs: [set_env, build, deploy, release]
name: Commit Code
env:
AGENT_VERSION: ${{ inputs.agent_version }}
environment: ${{ needs.set_env.outputs.ENV }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}

- name: Set BUILD_VERSION environment variable
run: echo "BUILD_VERSION=$(node -p "require('./package').version")" >> $GITHUB_ENV

- name: Change Package.json version for release
run: sed -i "s/$BUILD_VERSION/$AGENT_VERSION/g" package.json
# deploy:
# name: Deploy cloud agent
# environment: ${{ needs.set_env.outputs.ENV }}
# env:
# AGENT_VERSION: ${{ inputs.agent_version }}
# needs: [set_env, build]

# runs-on: ubuntu-latest

# steps:
# - name: Checkout code
# uses: actions/checkout@v4

# - name: Setup Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node-version }}

# - name: Install packages
# run: npm install --only dev

# - name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# role-to-assume: arn:aws:iam::${{ vars.AWS_ACCOUNT_ID }}:role/katalon-github-oidc-federation
# role-session-name: github-actions
# aws-region: ${{ vars.AWS_REGION }}
# mask-aws-account-id: 'no'

# - name: Download artifacts
# uses: actions/download-artifact@v4
# with:
# path: .

# - name: Add execute permission to downloaded artifacts
# run: chmod +x katalon-agent-linux-*/* katalon-agent-macos-*/*


# - name: Deploy to s3 prod
# if: ${{ needs.set_env.outputs.ENV == 'prod' }}
# run: |
# ls -laR
# aws s3 cp katalon-agent-linux-x64-*/cli-linux-x64 s3://${{ secrets.AWS_S3_BUCKET }}/katalon-agent/$AGENT_VERSION/cli-linux-x64

# commit:
# runs-on: ubuntu-latest
# needs: [set_env, build, deploy, release]
# name: Commit Code
# env:
# AGENT_VERSION: ${{ inputs.agent_version }}
# environment: ${{ needs.set_env.outputs.ENV }}
# steps:
# - uses: actions/checkout@v4
# with:
# token: ${{ secrets.GH_TOKEN }}

# - name: Set BUILD_VERSION environment variable
# run: echo "BUILD_VERSION=$(node -p "require('./package').version")" >> $GITHUB_ENV

# - name: Change Package.json version for release
# run: sed -i "s/$BUILD_VERSION/$AGENT_VERSION/g" package.json

### Commit code
- name: Deploy to GitOps
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update version to ${{ env.AGENT_VERSION }}
# Optional commit user and author settings
commit_user_name: github-cloudops-bot # defaults to "github-actions[bot]"
commit_user_email: github-cloudops-bot@katalon.com # defaults to "41898282+github-actions[bot]@users.noreply.github.com"
commit_author: Author <github-cloudops-bot@katalon.com> # defaults to author of the commit that triggered the run
# ### Commit code
# - name: Deploy to GitOps
# uses: stefanzweifel/git-auto-commit-action@v5
# with:
# commit_message: Update version to ${{ env.AGENT_VERSION }}
# # Optional commit user and author settings
# commit_user_name: github-cloudops-bot # defaults to "github-actions[bot]"
# commit_user_email: github-cloudops-bot@katalon.com # defaults to "41898282+github-actions[bot]@users.noreply.github.com"
# commit_author: Author <github-cloudops-bot@katalon.com> # defaults to author of the commit that triggered the run

0 comments on commit 1a3a611

Please sign in to comment.