Skip to content

Upload action-runner package to S3 if it's new #391

Upload action-runner package to S3 if it's new

Upload action-runner package to S3 if it's new #391

Workflow file for this run

---
name: Upload action-runner package to S3 if it's new
on:
workflow_dispatch:
schedule:
- cron: '0 4 * * *'
jobs:
upload-binary:
# Do not run this job on any fork repos
if: github.repository == 'virt-s1/kite-action'
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3
# Ansible has been installed already in github action runner by default
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md#tools
- name: Install Ansible modules and dependence
run: |
ansible-galaxy collection install amazon.aws
pip install botocore boto3
# Use system default python3 as ansible python interpreter
# By default ansible use /opt/pipx/venvs/ansible-core/bin/python as its python interpreter
- name: Run Ansible playbook to upload action-runner
run: ansible-playbook -v -e ansible_python_interpreter=/usr/bin/python3 tools/upload_runner_binary.yaml
env:
PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }}
upload-binary_prod:
# Do not run this job on any fork repos
if: github.repository == 'virt-s1/kite-action'
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3
# Ansible has been installed already in github action runner by default
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md#tools
- name: Install Ansible modules and dependence
run: |
ansible-galaxy collection install amazon.aws
pip install botocore boto3
# Use system default python3 as ansible python interpreter
# By default ansible use /opt/pipx/venvs/ansible-core/bin/python as its python interpreter
- name: Run Ansible playbook to upload x86_64 action-runner
run: ansible-playbook -v -e ansible_python_interpreter=/usr/bin/python3 -e github_actions_architecture=x64 tools/upload_runner_binary.yaml
env:
PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME_PROD }}
- name: Run Ansible playbook to upload arm64 action-runner
run: ansible-playbook -v -e ansible_python_interpreter=/usr/bin/python3 -e github_actions_architecture=arm64 tools/upload_runner_binary.yaml
env:
PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME_PROD }}
upload-binary_dev:
# Do not run this job on any fork repos
if: github.repository == 'virt-s1/kite-action'
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3
# Ansible has been installed already in github action runner by default
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md#tools
- name: Install Ansible modules and dependence
run: |
ansible-galaxy collection install amazon.aws
pip install botocore boto3
# Use system default python3 as ansible python interpreter
# By default ansible use /opt/pipx/venvs/ansible-core/bin/python as its python interpreter
- name: Run Ansible playbook to upload action-runner
run: ansible-playbook -v -e ansible_python_interpreter=/usr/bin/python3 -e github_actions_architecture=x64 tools/upload_runner_binary.yaml
env:
PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME_DEV }}
- name: Run Ansible playbook to upload arm64 action-runner
run: ansible-playbook -v -e ansible_python_interpreter=/usr/bin/python3 -e github_actions_architecture=arm64 tools/upload_runner_binary.yaml
env:
PERSONAL_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME_DEV }}