-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (60 loc) · 1.92 KB
/
Copy pathmain.yml
File metadata and controls
64 lines (60 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Runs when main branch is updated.
# Creates docker image & publishes to docker packages
# Uses ansible to trigger a redeployment of the latest code
name: Main Branch Build and Deploy
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 25
- name: Login to GitHub Container Registry
uses: docker/login-action@v4.5.2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run PR tests
run: make check
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: build and push docker containers
run: make docker-push
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Load SSH private key into ssh-agent
uses: webfactory/ssh-agent@v0.9.1
with:
ssh-private-key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: "3.12"
- name: Cache Ansible Galaxy collections
uses: actions/cache@v4
with:
path: ~/.ansible/collections
key: ansible-collections-${{ hashFiles('deploy/ansible/requirements.yml') }}
- name: Install Ansible and dependencies
run: |
uv tool install --with linode_api4 --with-executables-from ansible-core,ansible-lint ansible
ansible-galaxy collection install -r deploy/ansible/requirements.yml
- name: Deploy
env:
LINODE_ACCESS_TOKEN: ${{ secrets.LINODE_READ_ONLY_TOKEN }}
run: SSH_USER=deploy make deploy