This repository has been archived by the owner on Mar 29, 2024. It is now read-only.
multi create fix #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test-new-ci | |
permissions: | |
id-token: write | |
contents: read | |
packages: write | |
defaults: | |
run: | |
# We need -e -o pipefail for consistency with GitHub Actions' default behavior | |
shell: bash -e -o pipefail {0} | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
create-cluster: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.PAT }} | |
repository: ${{ github.repository }} | |
ref: ${{ github.ref_name }} | |
- name: Create k3s cluster in AWS | |
id: create-cluster | |
uses: defenseunicorns/uds-aws-ci-k3d@swf_additions | |
with: | |
cluster-action: create | |
aws-assume-role: ${{ secrets.AWS_COMMERCIAL_ROLE_TO_ASSUME_K3D }} | |
aws-region: us-west-2 | |
instance-size: "c7a.16xlarge" | |
ami-prefix: "rc-uds-ci-k3d" | |
k3s: "true" | |
- name: Upload kubeconfig artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: kubeconfig | |
path: ~/.kube/config | |
- name: Install Pepr lb module | |
run: | | |
kubectl apply -f test/lb-annotation-aws/pepr-module-lb-annotate.yaml | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.PAT }} | |
repository: ${{ github.repository }} | |
ref: ${{ github.ref_name }} | |
- name: Login to registry1 | |
uses: docker/login-action@v2 | |
with: | |
registry: registry1.dso.mil | |
username: ${{ secrets.REGISTRY1_USERNAME }} | |
password: ${{ secrets.REGISTRY1_PASSWORD }} | |
- name: Login to GHCR | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build bundle and all dependencies | |
run: | | |
make build/all | |
deploy: | |
runs-on: ubuntu-latest | |
needs: ["create-cluster", "build"] | |
steps: | |
- name: Create k3s cluster in AWS | |
id: create-cluster | |
uses: defenseunicorns/uds-aws-ci-k3d@swf_additions | |
with: | |
cluster-action: create | |
aws-assume-role: ${{ secrets.AWS_COMMERCIAL_ROLE_TO_ASSUME_K3D }} | |
aws-region: us-west-2 | |
instance-size: "c7a.16xlarge" | |
ami-prefix: "rc-uds-ci-k3d" | |
k3s: "true" | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.PAT }} | |
repository: ${{ github.repository }} | |
ref: ${{ github.ref_name }} | |
- name: Login to GHCR | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Download kubeconfig | |
uses: actions/download-artifact@v3 | |
with: | |
name: kubeconfig | |
path: ~/.kube/ | |
- name: Download zarf and uds-cli | |
run: | | |
ls -la ~/.kube/ | |
make build/zarf | |
make build/uds | |
- name: Move Zarf to /usr/local/bin | |
run: | | |
sudo mv build/zarf /usr/local/bin/zarf | |
sudo chmod +x /usr/local/bin/zarf | |
- name: Deploy bundle | |
run: | | |
make deploy | |
test: | |
runs-on: ubuntu-latest | |
needs: "deploy" | |
steps: | |
- name: Create k3s cluster in AWS | |
id: create-cluster | |
uses: defenseunicorns/uds-aws-ci-k3d@swf_additions | |
with: | |
cluster-action: create | |
aws-assume-role: ${{ secrets.AWS_COMMERCIAL_ROLE_TO_ASSUME_K3D }} | |
aws-region: us-west-2 | |
instance-size: "c7a.16xlarge" | |
ami-prefix: "rc-uds-ci-k3d" | |
k3s: "true" | |
- name: Download kubeconfig | |
uses: actions/download-artifact@v3 | |
with: | |
name: kubeconfig | |
path: ~/.kube/ | |
- name: Setup LB hostnames | |
run: | | |
utils/metallb/dns.sh | |
sudo utils/metallb/hosts-write.sh | |
- name: Run tests | |
run: | | |
kubectl rollout status deployment/gitlab-webservice-default -n gitlab --watch --timeout=1200s | |
curl https://keycloak.bigbang.dev | |
curl https://gitlab.bigbang.dev | |
curl https://grafana.bigbang.dev | |
teardown-cluster: | |
runs-on: ubuntu-latest | |
needs: "test" | |
if: always() | |
steps: | |
- name: Teardown k3s cluster | |
if: always() | |
# renovate: datasource=github-tags depName=defenseunicorns/uds-aws-ci-k3d versioning=semver | |
uses: defenseunicorns/uds-aws-ci-k3d@swf_additions | |
with: | |
cluster-action: destroy |