Skip to content

Check if tarball is there locally in the Github Action #844

Check if tarball is there locally in the Github Action

Check if tarball is there locally in the Github Action #844

Workflow file for this run

name: Publish Mini
on:
push:
jobs:
publish:
name: Publish artifacts
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install Packer
uses: hashicorp/setup-packer@main
- name: Install Packer plugins
run: |
packer plugins install github.com/hashicorp/amazon
packer plugins install github.com/hashicorp/googlecompute
packer plugins install github.com/hashicorp/ansible
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '1.22'
check-latest: true
- name: Run control-plane-api tests
run: |
cd $GITHUB_WORKSPACE/provisioning/resources/control-plane
go test *.go
- name: Provision a local Mini instance
run: ansible-playbook -i $GITHUB_WORKSPACE/provisioning/inventory $GITHUB_WORKSPACE/provisioning/local_setup.yml --connection=local --become
- id: 'auth'
if: startsWith(github.ref, 'refs/tags/')
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_JSON_BASE64 }}'
- name: 'Set up Cloud SDK'
if: startsWith(github.ref, 'refs/tags/')
uses: 'google-github-actions/setup-gcloud@v2'
- name: SSH config for Ansible
run: mkdir ~/.ssh && echo -e "Host 127.0.0.1\nHostKeyAlgorithms +ssh-rsa\nPubkeyAcceptedKeyTypes +ssh-rsa" >> ~/.ssh/config
- name: Publish artifact based on cloud and size
if: startsWith(github.ref, 'refs/tags/')
env:
AWS_DEPLOY_ACCESS_KEY: ${{ secrets.AWS_DEPLOY_ACCESS_KEY }}
AWS_DEPLOY_SECRET_KEY: ${{ secrets.AWS_DEPLOY_SECRET_KEY }}
GOOGLE_APPLICATION_CREDENTIALS_JSON_BASE64: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_JSON_BASE64 }}
run: $GITHUB_WORKSPACE/.github/workflows/deploy.sh ${{ github.ref_name }}