2024-09-19 12:15:02 -04:00
|
|
|
name: Gitea Actions CI
|
2024-09-19 10:44:54 -04:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [main]
|
|
|
|
pull_request:
|
|
|
|
branches: [main]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
tests:
|
2024-09-20 18:05:07 -04:00
|
|
|
name: Build and deploy
|
2024-09-19 10:44:54 -04:00
|
|
|
runs-on: ubuntu-latest
|
2024-09-19 10:49:35 -04:00
|
|
|
env:
|
|
|
|
EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }}
|
2024-09-20 09:33:52 -04:00
|
|
|
EARTHLY_DISABLE_REMOTE_REGISTRY_PROXY: "1"
|
2024-09-19 10:44:54 -04:00
|
|
|
steps:
|
2024-09-20 09:33:52 -04:00
|
|
|
- name: install earthly
|
2024-09-19 11:58:43 -04:00
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2024-09-19 11:59:13 -04:00
|
|
|
sudo apt-get install -y \
|
2024-09-19 11:58:43 -04:00
|
|
|
apt-transport-https \
|
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
gnupg \
|
|
|
|
lsb-release
|
|
|
|
curl -fsSL https://pkg.earthly.dev/earthly.pgp | sudo gpg --dearmor -o /usr/share/keyrings/earthly-archive-keyring.gpg
|
|
|
|
echo \
|
|
|
|
"deb [arch=amd64 signed-by=/usr/share/keyrings/earthly-archive-keyring.gpg] https://pkg.earthly.dev/deb \
|
|
|
|
stable main" | sudo tee /etc/apt/sources.list.d/earthly.list > /dev/null
|
|
|
|
sudo apt-get update
|
2024-09-19 11:59:13 -04:00
|
|
|
sudo apt-get install -y earthly
|
2024-09-19 10:49:35 -04:00
|
|
|
- uses: actions/checkout@v4
|
2024-09-20 09:33:52 -04:00
|
|
|
- name: docker login # to avoid dockerhub rate-limiting
|
2024-09-19 10:44:54 -04:00
|
|
|
run: docker login --username "${{ secrets.DOCKERHUB_USERNAME }}" --password "${{ secrets.DOCKERHUB_PASSWORD }}"
|
2024-09-20 09:33:52 -04:00
|
|
|
- name: log into ghcr.io
|
2024-09-19 10:55:05 -04:00
|
|
|
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: xe
|
|
|
|
password: ${{ secrets.GHCR_TOKEN }}
|
2024-09-19 11:48:25 -04:00
|
|
|
- name: use sat alpha
|
2024-09-19 10:51:14 -04:00
|
|
|
run: |
|
|
|
|
earthly org select me-2625
|
2024-09-20 09:37:30 -04:00
|
|
|
earthly sat select alpha
|
2024-09-19 12:02:24 -04:00
|
|
|
docker info
|
2024-09-19 12:05:51 -04:00
|
|
|
env
|
2024-09-20 09:33:52 -04:00
|
|
|
- name: build www image
|
2024-09-20 09:51:09 -04:00
|
|
|
run: earthly --push +run
|
|
|
|
- uses: actions-hub/kubectl@master
|
|
|
|
env:
|
2025-01-12 12:39:02 -05:00
|
|
|
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG_ALREST }}
|
|
|
|
KUBE_CONTEXT: alrest
|
2024-09-20 09:51:09 -04:00
|
|
|
with:
|
|
|
|
args: apply -k manifest
|
|
|
|
- uses: actions-hub/kubectl@master
|
2024-09-20 09:52:58 -04:00
|
|
|
env:
|
2025-01-12 12:39:02 -05:00
|
|
|
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG_ALREST }}
|
|
|
|
KUBE_CONTEXT: alrest
|
2024-09-20 09:51:09 -04:00
|
|
|
with:
|
|
|
|
args: rollout restart -n default deployment/techaro-lol
|