Skip to content

Commit

Permalink
perf: cache infra workflow dependencies (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrekucci authored May 31, 2024
1 parent 5a59116 commit 83cf622
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/infrstructure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ jobs:
path: |
~/go/pkg/mod
~/.cache/go-build
~/.local/pipx
/usr/local/bin/goreleaser
key: ${{ runner.os }}-go-${{ hashFiles('**/go.work.sum') }}
restore-keys: ${{ runner.os }}-go-

Expand All @@ -115,23 +117,25 @@ jobs:
check-latest: true
cache-dependency-path: go.work.sum

- name: Install Required Dependencies and Configure Control Machine
- name: Install Required Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list
sudo apt-get update
sudo apt-get install --yes goreleaser
pip install boto3 botocore
pipx inject ansible-core botocore boto3
- name: Configure Control Machine
run: |
sudo useradd --create-home ubuntu && sudo usermod --append --groups sudo ubuntu
ANSIBLE_CONNECTION="ansible_connection=local"
if [ "${IS_MANUAL_DEPLOYMENT}" == "true" ]; then
ANSIBLE_CONNECTION=""
export ANSIBLE_HOST_KEY_CHECKING=false
mkdir ~/.ssh && \
mkdir -p ~/.ssh && \
chmod 700 ~/.ssh && \
echo "${{ secrets.INFRASTRUCTURE_DEPLOYMENT_KEY }}" > ~/.ssh/id_ed25519 && \
chmod 600 ~/.ssh/id_ed25519
Expand Down

0 comments on commit 83cf622

Please sign in to comment.